├── .idea ├── .name ├── MMORPG.iml ├── compiler.xml ├── dataSources.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── uiDesigner.xml ├── vcs.xml └── workspace.xml ├── Readme.md ├── pom.xml ├── serProbuf.bat ├── serProbuf.sh ├── src ├── main │ ├── java │ │ └── com │ │ │ ├── game │ │ │ ├── annotation │ │ │ │ └── ExcelAnnotation.java │ │ │ ├── auction │ │ │ │ ├── bean │ │ │ │ │ └── Auction.java │ │ │ │ ├── handler │ │ │ │ │ └── AuctionHandler.java │ │ │ │ ├── mapper │ │ │ │ │ └── AuctionMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── AuctionRepository.java │ │ │ │ ├── service │ │ │ │ │ └── AuctionService.java │ │ │ │ └── task │ │ │ │ │ ├── AuctionTask.java │ │ │ │ │ ├── DeleteAuctionTask.java │ │ │ │ │ ├── InsertGoodsTask.java │ │ │ │ │ └── UpdateAuctionTask.java │ │ │ ├── backpack │ │ │ │ ├── bean │ │ │ │ │ ├── GoodsBag.java │ │ │ │ │ ├── GoodsEntity.java │ │ │ │ │ ├── GoodsResource.java │ │ │ │ │ └── GoodsType.java │ │ │ │ ├── excel │ │ │ │ │ ├── ReadGoods.java │ │ │ │ │ └── ReadGoodsType.java │ │ │ │ ├── handler │ │ │ │ │ ├── BackpackMsgHandler.java │ │ │ │ │ └── GoodsHandler.java │ │ │ │ ├── manager │ │ │ │ │ ├── LoadGoodsData.java │ │ │ │ │ ├── LocalGoodsManager.java │ │ │ │ │ └── MapCacheSchedule.java │ │ │ │ ├── mapper │ │ │ │ │ ├── BackPack2Mapper.java │ │ │ │ │ └── BackpackMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── BackpackRepository.java │ │ │ │ ├── service │ │ │ │ │ └── BackpackService.java │ │ │ │ └── task │ │ │ │ │ ├── BackpackInsertTask.java │ │ │ │ │ ├── BackpackUpdateDelTask.java │ │ │ │ │ ├── BackpackUpdateTask.java │ │ │ │ │ └── UpdateMapMsgTask.java │ │ │ ├── buff │ │ │ │ ├── bean │ │ │ │ │ └── ConcreteBuff.java │ │ │ │ ├── excel │ │ │ │ │ └── ReadBuff.java │ │ │ │ ├── handler │ │ │ │ │ ├── BuffHandler.java │ │ │ │ │ ├── BuffTask.java │ │ │ │ │ └── BuffType.java │ │ │ │ └── manager │ │ │ │ │ ├── AttackBuff.java │ │ │ │ │ ├── BlueBuff.java │ │ │ │ │ ├── BuffManager.java │ │ │ │ │ ├── DefendBuff.java │ │ │ │ │ ├── IBuff.java │ │ │ │ │ └── RedBuff.java │ │ │ ├── chat │ │ │ │ ├── handler │ │ │ │ │ └── ChatHandler.java │ │ │ │ └── service │ │ │ │ │ └── ChatService.java │ │ │ ├── client │ │ │ │ ├── Client.java │ │ │ │ ├── ClientHandler.java │ │ │ │ └── ClientInitializer.java │ │ │ ├── dispatcher │ │ │ │ ├── ClassAndMethodDTO.java │ │ │ │ ├── ClassUtil.java │ │ │ │ ├── DataCodeor.java │ │ │ │ ├── MyAnnotationUtil.java │ │ │ │ ├── RequestAnnotation.java │ │ │ │ ├── ResultDTO.java │ │ │ │ └── StringUtil.java │ │ │ ├── duplicate │ │ │ │ ├── handler │ │ │ │ │ └── DuplicateHandler.java │ │ │ │ ├── manager │ │ │ │ │ └── RoleAndMap.java │ │ │ │ ├── serivce │ │ │ │ │ └── DuplicateService.java │ │ │ │ └── task │ │ │ │ │ └── RoleAttackBossTask.java │ │ │ ├── email │ │ │ │ ├── handler │ │ │ │ │ └── EmailHandler.java │ │ │ │ └── service │ │ │ │ │ └── EmailService.java │ │ │ ├── equipment │ │ │ │ ├── bean │ │ │ │ │ ├── Equipment.java │ │ │ │ │ └── EquipmentBox.java │ │ │ │ ├── handler │ │ │ │ │ └── EquipHandler.java │ │ │ │ ├── manager │ │ │ │ │ └── EquipCacheSchedule.java │ │ │ │ ├── mapper │ │ │ │ │ └── EquipmentMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── EquipmentRepository.java │ │ │ │ ├── service │ │ │ │ │ └── EquipmentService.java │ │ │ │ └── task │ │ │ │ │ ├── InsertEquipmentBoxTask.java │ │ │ │ │ ├── UpdateEquipMsgTask.java │ │ │ │ │ └── UpdateEquipmentBoxTask.java │ │ │ ├── event │ │ │ │ ├── annotation │ │ │ │ │ └── EventAnnotation.java │ │ │ │ ├── beanevent │ │ │ │ │ ├── AttackedEvent.java │ │ │ │ │ ├── GoVillageEvent.java │ │ │ │ │ ├── GoodsEvent.java │ │ │ │ │ ├── MonsterDeadEvent.java │ │ │ │ │ ├── TalkEvent.java │ │ │ │ │ └── TradeEvent.java │ │ │ │ ├── core │ │ │ │ │ ├── EventBusManager.java │ │ │ │ │ ├── IEvent.java │ │ │ │ │ ├── IEventBusManager.java │ │ │ │ │ └── InjectEventHandler.java │ │ │ │ ├── handler │ │ │ │ │ ├── AttackedHandler.java │ │ │ │ │ ├── CancleBuff.java │ │ │ │ │ ├── GoVillageHandler.java │ │ │ │ │ ├── HandlerUtils.java │ │ │ │ │ ├── IHandler.java │ │ │ │ │ ├── KillMonsterHandler.java │ │ │ │ │ ├── TalkHandler.java │ │ │ │ │ ├── Trade2Handler.java │ │ │ │ │ └── UseGoodsHandler.java │ │ │ │ ├── manager │ │ │ │ │ ├── EventMap.java │ │ │ │ │ └── EventTaskMap.java │ │ │ │ └── task │ │ │ │ │ └── RecoveryMonsterTask.java │ │ │ ├── gang │ │ │ │ ├── bean │ │ │ │ │ ├── GangEntity.java │ │ │ │ │ ├── GangMemberEntity.java │ │ │ │ │ ├── Job.java │ │ │ │ │ ├── JobPermission.java │ │ │ │ │ └── JobResource.java │ │ │ │ ├── excel │ │ │ │ │ └── ReadPermission.java │ │ │ │ ├── handler │ │ │ │ │ └── GangHandler.java │ │ │ │ ├── manager │ │ │ │ │ ├── JobPermissionMap.java │ │ │ │ │ └── JobPermissionMapping.java │ │ │ │ ├── mapper │ │ │ │ │ ├── GangEntityMapper.java │ │ │ │ │ └── GangMemberEntityMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── GangRepository.java │ │ │ │ ├── service │ │ │ │ │ └── GangService.java │ │ │ │ └── task │ │ │ │ │ ├── InsertGangMemberTask.java │ │ │ │ │ ├── InsertGangTask.java │ │ │ │ │ └── UpdateGangEntityTask.java │ │ │ ├── map │ │ │ │ ├── bean │ │ │ │ │ ├── ConcreteMap.java │ │ │ │ │ └── MapMapping.java │ │ │ │ ├── excel │ │ │ │ │ ├── ReadMap.java │ │ │ │ │ └── ReadMapMapping.java │ │ │ │ ├── handler │ │ │ │ │ └── MapHandler.java │ │ │ │ ├── manager │ │ │ │ │ └── MapFactory.java │ │ │ │ ├── mapper │ │ │ │ │ └── MapMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── MapRepository.java │ │ │ │ ├── service │ │ │ │ │ └── MapService.java │ │ │ │ ├── task │ │ │ │ │ └── BossAutoAttackTask.java │ │ │ │ └── threadpool │ │ │ │ │ ├── MapThreadPool.java │ │ │ │ │ ├── SingleThread.java │ │ │ │ │ └── TaskQueue.java │ │ │ ├── notice │ │ │ │ ├── NoticeBean.java │ │ │ │ └── NoticeUtils.java │ │ │ ├── npc │ │ │ │ ├── bean │ │ │ │ │ ├── ConcreteMonster.java │ │ │ │ │ ├── ConcreteNPC.java │ │ │ │ │ ├── MapNPCMapping.java │ │ │ │ │ └── MonsterMapMapping.java │ │ │ │ ├── excel │ │ │ │ │ ├── monster │ │ │ │ │ │ ├── ReadMonster.java │ │ │ │ │ │ └── ReadMonsterMapMapping.java │ │ │ │ │ └── npc │ │ │ │ │ │ ├── ReadMapNPCMapping.java │ │ │ │ │ │ └── ReadNPC.java │ │ │ │ ├── handler │ │ │ │ │ └── NpcHandler.java │ │ │ │ └── service │ │ │ │ │ └── NpcService.java │ │ │ ├── occupation │ │ │ │ ├── bean │ │ │ │ │ └── Occupation.java │ │ │ │ ├── excel │ │ │ │ │ └── ReadOccupation.java │ │ │ │ └── manager │ │ │ │ │ └── OccupationMap.java │ │ │ ├── property │ │ │ │ ├── bean │ │ │ │ │ ├── Property.java │ │ │ │ │ └── PropertyType.java │ │ │ │ ├── excel │ │ │ │ │ └── ReadProperty.java │ │ │ │ └── manager │ │ │ │ │ ├── InjectProperty.java │ │ │ │ │ └── PropertyManager.java │ │ │ ├── protobuf │ │ │ │ ├── Goods.proto │ │ │ │ ├── Map.proto │ │ │ │ ├── MsgAuctionInfo.proto │ │ │ │ ├── MsgBossInfo.proto │ │ │ │ ├── MsgChatInfo.proto │ │ │ │ ├── MsgEmailInfo.proto │ │ │ │ ├── MsgEquipInfo.proto │ │ │ │ ├── MsgGangInfo.proto │ │ │ │ ├── MsgGoodsInfo.proto │ │ │ │ ├── MsgMapInfo.proto │ │ │ │ ├── MsgNpcInfo.proto │ │ │ │ ├── MsgRankInfo.proto │ │ │ │ ├── MsgRoleInfo.proto │ │ │ │ ├── MsgShopInfo.proto │ │ │ │ ├── MsgSkillInfo.proto │ │ │ │ ├── MsgTaskInfo.proto │ │ │ │ ├── MsgTradeInfo.proto │ │ │ │ ├── MsgUserInfo.proto │ │ │ │ ├── Npc.proto │ │ │ │ ├── Role.proto │ │ │ │ ├── message │ │ │ │ │ ├── ContentType.java │ │ │ │ │ ├── MessageType.java │ │ │ │ │ └── ResultCode.java │ │ │ │ └── service │ │ │ │ │ └── ProtoService.java │ │ │ ├── rank │ │ │ │ ├── bean │ │ │ │ │ └── RankBean.java │ │ │ │ ├── handler │ │ │ │ │ └── RankHandler.java │ │ │ │ ├── manager │ │ │ │ │ └── RankManager.java │ │ │ │ ├── mapper │ │ │ │ │ └── RankMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── RankRepository.java │ │ │ │ └── service │ │ │ │ │ └── RankService.java │ │ │ ├── role │ │ │ │ ├── bean │ │ │ │ │ └── ConcreteRole.java │ │ │ │ ├── handler │ │ │ │ │ └── RoleHandler.java │ │ │ │ ├── manager │ │ │ │ │ ├── InjectRoleProperty.java │ │ │ │ │ └── RoleCacheSchedule.java │ │ │ │ ├── mapper │ │ │ │ │ └── RoleMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── RoleRepository.java │ │ │ │ ├── service │ │ │ │ │ └── RoleService.java │ │ │ │ └── task │ │ │ │ │ ├── InsertRoleTask.java │ │ │ │ │ ├── RoleTask.java │ │ │ │ │ ├── RoleUpdateTask.java │ │ │ │ │ └── UpdateRoleMsgTask.java │ │ │ ├── server │ │ │ │ ├── Server.java │ │ │ │ ├── ServerHandler.java │ │ │ │ ├── ServerInitializer.java │ │ │ │ ├── SpringMain.java │ │ │ │ ├── codec │ │ │ │ │ ├── CustomProtobufDecoder.java │ │ │ │ │ └── CustomProtobufEncoder.java │ │ │ │ ├── handler │ │ │ │ │ ├── DispatcherHandler.java │ │ │ │ │ └── ServerIdleStateHandler.java │ │ │ │ ├── local │ │ │ │ │ ├── LocalMessageMap.java │ │ │ │ │ └── LocalUserData.java │ │ │ │ ├── manager │ │ │ │ │ ├── BuffMap.java │ │ │ │ │ └── TaskMap.java │ │ │ │ ├── request │ │ │ │ │ ├── RequestAuctionInfoType.java │ │ │ │ │ ├── RequestBossInfoType.java │ │ │ │ │ ├── RequestChatInfoType.java │ │ │ │ │ ├── RequestEmailInfoType.java │ │ │ │ │ ├── RequestEquipInfoType.java │ │ │ │ │ ├── RequestGangInfoType.java │ │ │ │ │ ├── RequestGoodsInfoType.java │ │ │ │ │ ├── RequestMapInfoType.java │ │ │ │ │ ├── RequestNpcInfoType.java │ │ │ │ │ ├── RequestRankInfoType.java │ │ │ │ │ ├── RequestRoleInfoType.java │ │ │ │ │ ├── RequestShopInfoType.java │ │ │ │ │ ├── RequestSkillInfoType.java │ │ │ │ │ ├── RequestTaskInfoType.java │ │ │ │ │ ├── RequestTradeInfoType.java │ │ │ │ │ └── RequestUserInfoType.java │ │ │ │ └── task │ │ │ │ │ └── DispatcherTask.java │ │ │ ├── shop │ │ │ │ ├── ShopService │ │ │ │ │ └── ShopService.java │ │ │ │ ├── handler │ │ │ │ │ └── ShopHandler.java │ │ │ │ └── manager │ │ │ │ │ └── ShopManager.java │ │ │ ├── skill │ │ │ │ ├── bean │ │ │ │ │ └── ConcreteSkill.java │ │ │ │ ├── excel │ │ │ │ │ └── ReadSkill.java │ │ │ │ ├── handler │ │ │ │ │ └── SkillHandler.java │ │ │ │ └── service │ │ │ │ │ └── SkillService.java │ │ │ ├── task │ │ │ │ ├── bean │ │ │ │ │ ├── ConcreteTask.java │ │ │ │ │ ├── RoleTask.java │ │ │ │ │ └── UpdateTaskTask.java │ │ │ │ ├── excel │ │ │ │ │ └── ReadTask.java │ │ │ │ ├── handler │ │ │ │ │ └── TaskHandler.java │ │ │ │ ├── manager │ │ │ │ │ ├── InjectTaskData.java │ │ │ │ │ └── TaskMap.java │ │ │ │ ├── mapper │ │ │ │ │ └── TaskMapper.java │ │ │ │ ├── repository │ │ │ │ │ └── TaskRepository.java │ │ │ │ └── service │ │ │ │ │ └── TaskService.java │ │ │ ├── team │ │ │ │ ├── bean │ │ │ │ │ └── Team.java │ │ │ │ ├── manager │ │ │ │ │ └── TeamMapManager.java │ │ │ │ ├── mapper │ │ │ │ │ └── TeamMapper.java │ │ │ │ └── repository │ │ │ │ │ └── TeamRepository.java │ │ │ ├── trade │ │ │ │ ├── bean │ │ │ │ │ └── Trade.java │ │ │ │ ├── handler │ │ │ │ │ └── TradeHandler.java │ │ │ │ ├── manager │ │ │ │ │ └── TradeMap.java │ │ │ │ ├── service │ │ │ │ │ └── TradeService.java │ │ │ │ └── task │ │ │ │ │ └── Task.java │ │ │ ├── user │ │ │ │ ├── bean │ │ │ │ │ └── User.java │ │ │ │ ├── handler │ │ │ │ │ ├── UserHandler.java │ │ │ │ │ └── UserInfoHandler.java │ │ │ │ ├── manager │ │ │ │ │ ├── LocalUserMap.java │ │ │ │ │ └── SessionMap.java │ │ │ │ ├── mapper │ │ │ │ │ └── UserMapper.java │ │ │ │ ├── repository │ │ │ │ │ ├── LoginRepository.java │ │ │ │ │ ├── RegisterRepository.java │ │ │ │ │ └── UserRepository.java │ │ │ │ ├── service │ │ │ │ │ ├── Login.java │ │ │ │ │ ├── RegisterService.java │ │ │ │ │ └── UserService.java │ │ │ │ ├── task │ │ │ │ │ ├── UpdateUserTask.java │ │ │ │ │ └── UserRegisterTask.java │ │ │ │ └── threadpool │ │ │ │ │ ├── SingleThread.java │ │ │ │ │ └── UserThreadPool.java │ │ │ └── utils │ │ │ │ ├── CacheUtils.java │ │ │ │ ├── EnumUtil.java │ │ │ │ ├── ExcelUtils.java │ │ │ │ ├── ProtobufUtils.java │ │ │ │ ├── QuestType.java │ │ │ │ ├── RequestTask.java │ │ │ │ ├── SqlUtils.java │ │ │ │ └── ThreadPoolUtils.java │ │ │ ├── hailintang │ │ │ ├── gameclient2 │ │ │ │ ├── Client.java │ │ │ │ ├── ClientHandler.java │ │ │ │ └── ClientInitializer.java │ │ │ ├── gameserver2 │ │ │ │ ├── Main │ │ │ │ │ └── Main.java │ │ │ │ ├── State │ │ │ │ │ ├── AliveState.java │ │ │ │ │ ├── DeadState.java │ │ │ │ │ ├── ForbidState.java │ │ │ │ │ └── State.java │ │ │ │ ├── map │ │ │ │ │ ├── Castle.java │ │ │ │ │ ├── CentralMap.java │ │ │ │ │ ├── Forest.java │ │ │ │ │ ├── Map.java │ │ │ │ │ ├── MapInfo.java │ │ │ │ │ ├── Origin.java │ │ │ │ │ └── Village.java │ │ │ │ ├── role │ │ │ │ │ ├── ParentRole.java │ │ │ │ │ ├── Role_01.java │ │ │ │ │ └── Role_02.java │ │ │ │ └── server │ │ │ │ │ ├── Server.java │ │ │ │ │ ├── ServerHandler.java │ │ │ │ │ └── ServerInitializer.java │ │ │ ├── map │ │ │ │ ├── Map.java │ │ │ │ └── Origin.java │ │ │ ├── netty_http_test │ │ │ │ ├── TestHttpServerHandler.java │ │ │ │ ├── TestServer.java │ │ │ │ └── TestServerInitializer.java │ │ │ ├── protobuf_netty │ │ │ │ ├── MyClient.java │ │ │ │ ├── MyClientHandler.java │ │ │ │ ├── MyClientInitializer.java │ │ │ │ ├── MyServer.java │ │ │ │ ├── MyServerHandler.java │ │ │ │ ├── MyServerInitializer.java │ │ │ │ └── PersonInfo.java │ │ │ ├── read_write_monitor │ │ │ │ ├── MyHandler.java │ │ │ │ ├── MyInitializer.java │ │ │ │ └── MyServer.java │ │ │ ├── service │ │ │ │ ├── Login.java │ │ │ │ └── Register.java │ │ │ ├── socket_chat_server_multiclient │ │ │ │ ├── client │ │ │ │ │ ├── MyChatClient.java │ │ │ │ │ ├── MyChatClientHandler.java │ │ │ │ │ └── MyChatClientInitializer.java │ │ │ │ └── server │ │ │ │ │ ├── MyChatInitializer.java │ │ │ │ │ ├── MyChatServer.java │ │ │ │ │ └── MyChatServerHandler.java │ │ │ ├── socket_server_client │ │ │ │ ├── MyClient.java │ │ │ │ ├── MyClientHandler.java │ │ │ │ ├── MyClientInitializer.java │ │ │ │ ├── MyServer.java │ │ │ │ ├── MyServerHandler.java │ │ │ │ └── MyServerInitializer.java │ │ │ ├── socket_server_multiclient │ │ │ │ ├── MyClient.java │ │ │ │ ├── MyClientHandler.java │ │ │ │ ├── MyClientInitializer.java │ │ │ │ ├── MyServer.java │ │ │ │ ├── MyServerHandler.java │ │ │ │ └── MyServerInitializer.java │ │ │ └── web_socket_demo01 │ │ │ │ ├── MyTextWebSocketFrame.java │ │ │ │ ├── MyWebSocketInitializer.java │ │ │ │ └── MyWebSocketServer.java │ │ │ └── test │ │ │ ├── Code_01_InsertionSort.java │ │ │ ├── Main.java │ │ │ ├── annotation │ │ │ ├── BusinessLogic.java │ │ │ ├── Todo.java │ │ │ ├── TodoReport.java │ │ │ ├── acm │ │ │ │ ├── Array2BigNum.java │ │ │ │ ├── Find1Num.java │ │ │ │ └── UglyNum.java │ │ │ └── firstexample │ │ │ │ ├── House.java │ │ │ │ ├── Meal.java │ │ │ │ ├── MealContainer.java │ │ │ │ ├── MyAnnotation.java │ │ │ │ └── MyHouse.java │ │ │ ├── event │ │ │ └── EventBus.java │ │ │ ├── eventbus │ │ │ ├── DataObserver1.java │ │ │ ├── DateObserver2.java │ │ │ ├── EventBusCenter.java │ │ │ └── Test.java │ │ │ ├── io │ │ │ ├── AIO │ │ │ │ └── AioServer.java │ │ │ ├── BIO │ │ │ │ ├── BioServer.java │ │ │ │ └── Client.java │ │ │ └── NIO │ │ │ │ └── NioServer.java │ │ │ ├── jdk8 │ │ │ └── lambda │ │ │ │ └── Demo01.java │ │ │ ├── juc │ │ │ ├── damondemo │ │ │ │ └── MyTest.java │ │ │ ├── demo01 │ │ │ │ ├── MyThread.java │ │ │ │ └── TestThread.java │ │ │ ├── demo02 │ │ │ │ ├── MyThread.java │ │ │ │ └── TestInterrupt.java │ │ │ ├── demo03 │ │ │ │ ├── MyThread.java │ │ │ │ └── Test.java │ │ │ ├── demo04 │ │ │ │ ├── MyThread.java │ │ │ │ └── Test.java │ │ │ ├── sleepdemo │ │ │ │ └── SleepTest.java │ │ │ └── yielddemo │ │ │ │ └── YieldTest.java │ │ │ ├── lambda │ │ │ ├── demo01 │ │ │ │ ├── Myfunc.java │ │ │ │ └── TestLambda.java │ │ │ ├── demo02 │ │ │ │ ├── Employee.java │ │ │ │ └── TestLambda.java │ │ │ ├── demo03 │ │ │ │ ├── MyFunc.java │ │ │ │ └── TestLambda.java │ │ │ ├── demo04 │ │ │ │ ├── MyFunc.java │ │ │ │ └── TestLambda.java │ │ │ ├── demo05 │ │ │ │ └── TestLambda.java │ │ │ └── demo06 │ │ │ │ └── TestMethodRef.java │ │ │ ├── load │ │ │ ├── AbstractConfigLoader.java │ │ │ ├── AppleConfig.java │ │ │ ├── ConfigProviderFactory.java │ │ │ ├── EggConfig.java │ │ │ ├── IConfigLoader.java │ │ │ ├── IConfigProvider.java │ │ │ ├── MarketConfig.java │ │ │ ├── MarketConfigLoader.java │ │ │ ├── OwnerConfig.java │ │ │ ├── OwnerConfigLoader.java │ │ │ ├── demo01 │ │ │ │ ├── BMWCar.java │ │ │ │ ├── BYDCar.java │ │ │ │ ├── ICarFactory.java │ │ │ │ └── TestMain.java │ │ │ └── demo02 │ │ │ │ └── Dom4jDemo.java │ │ │ ├── netty │ │ │ └── TestFuture.java │ │ │ ├── observer │ │ │ ├── FirstObserver.java │ │ │ ├── Observer.java │ │ │ ├── SecondObserver.java │ │ │ ├── Subject.java │ │ │ ├── Test.java │ │ │ └── ThirdObserver.java │ │ │ ├── stackoverflow │ │ │ ├── Question01.java │ │ │ ├── Question02.java │ │ │ ├── Question03.java │ │ │ ├── Question04.java │ │ │ └── Question05.java │ │ │ ├── testgameserverclient │ │ │ ├── Action.java │ │ │ ├── ActionBeanPostProcessor.java │ │ │ ├── ActionMap.java │ │ │ ├── ActionMapUtil.java │ │ │ ├── ClientTest.java │ │ │ ├── Header.java │ │ │ ├── Message.java │ │ │ ├── MessageDecoder.java │ │ │ ├── MessageEncoder.java │ │ │ ├── NettyController.java │ │ │ ├── ServerHandler.java │ │ │ ├── Test.java │ │ │ ├── TimeServer.java │ │ │ └── UserAction.java │ │ │ └── testmysql │ │ │ ├── Parsing.java │ │ │ ├── TestDemo01.java │ │ │ └── TestNetty.java │ └── resources │ │ ├── applicationContext.xml │ │ ├── config │ │ └── mybatis-config.xml │ │ ├── excel │ │ ├── Buff.xls │ │ ├── Goods.xls │ │ ├── GoodsType.xls │ │ ├── Map.xlsx │ │ ├── MapMapping.xls │ │ ├── MapNpcMapping.xls │ │ ├── Monster.xls │ │ ├── MonsterMapMapping.xls │ │ ├── Npc.xls │ │ ├── Occupation.xls │ │ ├── Permission.xls │ │ ├── Property.xls │ │ ├── Skill.xls │ │ └── Task.xls │ │ ├── load │ │ ├── factory.xml │ │ ├── market.xml │ │ └── owner.properties │ │ ├── log4j.properties │ │ ├── mapper │ │ ├── AuctionMapper.xml │ │ ├── Backpack2Mapper.xml │ │ ├── BackpackMapper.xml │ │ ├── EquipmentMapper.xml │ │ ├── GangEntityMapper.xml │ │ ├── GangMemberEntityMapper.xml │ │ ├── MapMapper.xml │ │ ├── RankMapper.xml │ │ ├── RoleMapper.xml │ │ ├── StateMapper.xml │ │ ├── TaskMapper.xml │ │ ├── TeamMapper.xml │ │ └── UserMapper.xml │ │ ├── my.properties │ │ └── mybatis │ │ └── generatorConfig.xml └── webapp │ └── test.html └── target └── classes └── com ├── game ├── client │ ├── Client.class │ ├── ClientHandler.class │ └── ClientInitializer.class ├── dispatcher │ ├── ClassAndMethodDTO.class │ ├── ClassUtil.class │ ├── DataCodeor.class │ ├── MyAnnotationUtil.class │ ├── RequestAnnotation.class │ ├── ResultDTO.class │ └── StringUtil.class ├── server │ ├── Server.class │ ├── ServerHandler.class │ └── ServerInitializer.class └── utils │ └── SqlUtils.class ├── hailintang ├── gameclient2 │ ├── Client.class │ ├── ClientHandler.class │ └── ClientInitializer.class ├── gameserver2 │ ├── Main │ │ └── Main.class │ ├── State │ │ ├── AliveState.class │ │ ├── DeadState.class │ │ ├── ForbidState.class │ │ └── State.class │ ├── map │ │ ├── Castle.class │ │ ├── CentralMap.class │ │ ├── Forest.class │ │ ├── Map.class │ │ ├── MapInfo.class │ │ ├── Origin.class │ │ └── Village.class │ ├── role │ │ ├── ParentRole.class │ │ ├── Role_01.class │ │ └── Role_02.class │ └── server │ │ ├── Server.class │ │ ├── ServerHandler.class │ │ └── ServerInitializer.class ├── map │ ├── Map.class │ └── Origin.class ├── netty_http_test │ ├── TestHttpServerHandler.class │ ├── TestServer.class │ └── TestServerInitializer.class ├── protobuf_netty │ ├── MyClient.class │ ├── MyClientHandler.class │ ├── MyClientInitializer.class │ ├── MyServer.class │ ├── MyServerHandler.class │ ├── MyServerInitializer.class │ ├── PersonInfo$1.class │ ├── PersonInfo$Student$1.class │ ├── PersonInfo$Student$Builder.class │ ├── PersonInfo$Student.class │ ├── PersonInfo$StudentOrBuilder.class │ └── PersonInfo.class ├── read_write_monitor │ ├── MyHandler$1.class │ ├── MyHandler.class │ ├── MyInitializer.class │ └── MyServer.class ├── service │ ├── Login.class │ └── Register.class ├── socket_chat_server_multiclient │ ├── client │ │ ├── MyChatClient.class │ │ ├── MyChatClientHandler.class │ │ └── MyChatClientInitializer.class │ └── server │ │ ├── MyChatInitializer.class │ │ ├── MyChatServer.class │ │ └── MyChatServerHandler.class ├── socket_server_client │ ├── MyClient.class │ ├── MyClientHandler.class │ ├── MyClientInitializer.class │ ├── MyServer.class │ ├── MyServerHandler.class │ └── MyServerInitializer.class ├── socket_server_multiclient │ ├── MyClient.class │ ├── MyClientHandler.class │ ├── MyClientInitializer.class │ ├── MyServer.class │ ├── MyServerHandler.class │ └── MyServerInitializer.class └── web_socket_demo01 │ ├── MyTextWebSocketFrame.class │ ├── MyWebSocketInitializer.class │ └── MyWebSocketServer.class └── test ├── Main.class ├── annotation ├── BusinessLogic.class ├── Todo$Priority.class ├── Todo$Status.class ├── Todo.class └── TodoReport.class ├── io ├── AIO │ ├── AioServer$1.class │ ├── AioServer$2.class │ └── AioServer.class ├── BIO │ ├── BioServer.class │ └── Client.class └── NIO │ └── NioServer.class ├── jdk8 └── lambda │ └── Demo01.class ├── load ├── AbstractConfigLoader.class ├── AppleConfig.class ├── ConfigProviderFactory.class ├── EggConfig.class ├── IConfigLoader.class ├── IConfigProvider.class ├── MarketConfig.class ├── MarketConfigLoader.class ├── OwnerConfig.class ├── OwnerConfigLoader.class ├── demo01 │ ├── BMWCar.class │ ├── BYDCar.class │ ├── ICarFactory.class │ └── TestMain.class └── demo02 │ └── Dom4jDemo.class └── testgameserverclient ├── Action.class ├── ActionBeanPostProcessor.class ├── ActionMap.class ├── ActionMapUtil.class ├── ClientTest.class ├── Header.class ├── Message.class ├── MessageDecoder.class ├── MessageEncoder.class ├── NettyController.class ├── ServerHandler.class ├── Test.class ├── TimeServer$1.class ├── TimeServer.class └── UserAction.class /.idea/.name: -------------------------------------------------------------------------------- 1 | testdemo -------------------------------------------------------------------------------- /.idea/MMORPG.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql.8 6 | true 7 | com.mysql.cj.jdbc.Driver 8 | jdbc:mysql://www.hailintang.top:3306/game 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/game/annotation/ExcelAnnotation.java: -------------------------------------------------------------------------------- 1 | package com.game.annotation; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | * @author Aaron 10 | * @date 2019/6/8 5:59 PM 11 | * @function 识别excel静态数据,纯标记 12 | */ 13 | @Component 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface ExcelAnnotation { 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/game/auction/mapper/AuctionMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.auction.mapper; 2 | 3 | import com.game.auction.bean.Auction; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 拍卖行mapper 9 | */ 10 | public interface AuctionMapper { 11 | /** 12 | * 添加物品 13 | * @param auction 拍卖行 14 | * @return 15 | */ 16 | public Integer insertGoods(Auction auction); 17 | 18 | /** 19 | * 查询所有拍卖物品 20 | * @return 21 | */ 22 | public List queryAllGoods(); 23 | 24 | /** 25 | * 根据id查询拍卖物品 26 | * @param auctionId 拍卖唯一id 27 | * @return 28 | */ 29 | public Auction queryAutionById(int auctionId); 30 | 31 | /** 32 | * 下架拍卖物品或物品竞拍结束 33 | * @param auctionId 拍卖唯一Id 34 | */ 35 | public void deleteAuction(int auctionId); 36 | 37 | /** 38 | * 更新拍卖 39 | * @param auction 拍卖唯一id 40 | */ 41 | public void updateAuction(Auction auction); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/game/backpack/bean/GoodsBag.java: -------------------------------------------------------------------------------- 1 | package com.game.backpack.bean; 2 | 3 | /** 4 | * @ClassName GoodsBag 5 | * @Description 小背包 6 | * @Author DELL 7 | * @Date 2019/9/4 12:29 8 | * @Version 1.0 9 | */ 10 | public class GoodsBag { 11 | /** 12 | * 商品id 13 | */ 14 | private String goodsId; 15 | /** 16 | * 商品数量 17 | */ 18 | private String count; 19 | 20 | public String getGoodsId() { 21 | return goodsId; 22 | } 23 | 24 | public void setGoodsId(String goodsId) { 25 | this.goodsId = goodsId; 26 | } 27 | 28 | public String getCount() { 29 | return count; 30 | } 31 | 32 | public void setCount(String count) { 33 | this.count = count; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/game/backpack/bean/GoodsEntity.java: -------------------------------------------------------------------------------- 1 | package com.game.backpack.bean; 2 | 3 | /** 4 | * @ClassName GoodsEntity 5 | * @Description 数据库实体类 6 | * @Author DELL 7 | * @Date 2019/9/4 11:19 8 | * @Version 1.0 9 | */ 10 | public class GoodsEntity { 11 | /** 12 | * 角色id 13 | */ 14 | private String roleId; 15 | /** 16 | * 商品背包 17 | */ 18 | private String goodsBag; 19 | 20 | public String getRoleId() { 21 | return roleId; 22 | } 23 | 24 | public void setRoleId(String roleId) { 25 | this.roleId = roleId; 26 | } 27 | 28 | public String getGoodsBag() { 29 | return goodsBag; 30 | } 31 | 32 | public void setGoodsBag(String goodsBag) { 33 | this.goodsBag = goodsBag; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/game/backpack/bean/GoodsType.java: -------------------------------------------------------------------------------- 1 | package com.game.backpack.bean; 2 | 3 | /** 4 | * @ClassName GoodsType 5 | * @Description 商品种类 6 | * @Author DELL 7 | * @Date 2019/6/17 18:29 8 | * @Version 1.0 9 | */ 10 | public class GoodsType { 11 | /** 12 | * 类型唯一id 13 | */ 14 | private Integer id; 15 | /** 16 | * 类型名字 17 | */ 18 | private String name; 19 | 20 | public Integer getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Integer id) { 25 | this.id = id; 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/game/backpack/manager/LocalGoodsManager.java: -------------------------------------------------------------------------------- 1 | package com.game.backpack.manager; 2 | 3 | import com.game.backpack.bean.GoodsBag; 4 | 5 | import java.util.HashMap; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | * @ClassName LocalGoodsManager 11 | * @Description 物品的缓存管理器 12 | * @Author DELL 13 | * @Date 2019/9/4 20:56 14 | * @Version 1.0 15 | */ 16 | public class LocalGoodsManager { 17 | private static volatile Map> localGoodsMap = new HashMap<>(); 18 | 19 | private LocalGoodsManager(){} 20 | 21 | public static Map> getLocalGoodsMap(){ 22 | return localGoodsMap; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/game/backpack/manager/MapCacheSchedule.java: -------------------------------------------------------------------------------- 1 | package com.game.backpack.manager; 2 | 3 | import com.game.annotation.ExcelAnnotation; 4 | import com.game.backpack.service.BackpackService; 5 | import com.game.backpack.task.UpdateMapMsgTask; 6 | import com.game.user.threadpool.UserThreadPool; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.util.concurrent.TimeUnit; 11 | 12 | /** 13 | * @ClassName MapCacheSchedule 14 | * @Description 刷新缓存定时器 15 | * @Author DELL 16 | * @Date 2019/8/26 22:13 17 | * @Version 1.0 18 | */ 19 | @Component 20 | @ExcelAnnotation 21 | public class MapCacheSchedule { 22 | @Autowired 23 | private BackpackService backpackService; 24 | @ExcelAnnotation 25 | public void submit(){ 26 | //创建任务 27 | UpdateMapMsgTask updateMapMsgTask = new UpdateMapMsgTask(backpackService); 28 | //执行任务 29 | UserThreadPool.ACCOUNT_SERVICE[1].scheduleAtFixedRate(updateMapMsgTask,10L,5L, TimeUnit.SECONDS); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/backpack/mapper/BackPack2Mapper.java: -------------------------------------------------------------------------------- 1 | package com.game.backpack.mapper; 2 | 3 | import com.game.backpack.bean.GoodsEntity; 4 | 5 | import java.util.List; 6 | 7 | public interface BackPack2Mapper { 8 | /** 9 | * 根据角色id找goods 10 | * @param roleId 角色id 11 | * @return 12 | */ 13 | public GoodsEntity getGoodsEntityByRoleId(int roleId); 14 | 15 | /** 16 | * 查询所有物品 17 | * @return 18 | */ 19 | public List getGoodsEntity(); 20 | 21 | /** 22 | * 保存物品信息 23 | */ 24 | public void saveGoodsInfo(GoodsEntity goodsEntity); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/game/backpack/task/BackpackInsertTask.java: -------------------------------------------------------------------------------- 1 | package com.game.backpack.task; 2 | 3 | import com.game.backpack.bean.GoodsResource; 4 | import com.game.backpack.mapper.BackpackMapper; 5 | import com.game.utils.SqlUtils; 6 | import org.apache.ibatis.session.SqlSession; 7 | 8 | /** 9 | * @ClassName BackpackInsertTask 10 | * @Description 添加物品任务 11 | * @Author DELL 12 | * @Date 2019/6/19 10:57 13 | * @Version 1.0 14 | */ 15 | public class BackpackInsertTask implements Runnable { 16 | /** 17 | * 物品 18 | */ 19 | private GoodsResource goods; 20 | public BackpackInsertTask(GoodsResource goods){ 21 | this.goods = goods; 22 | } 23 | @Override 24 | public void run() { 25 | SqlSession session = SqlUtils.getSession(); 26 | try{ 27 | BackpackMapper mapper = session.getMapper(BackpackMapper.class); 28 | mapper.insertGoods(goods); 29 | session.commit(); 30 | }finally { 31 | session.close(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/game/buff/handler/BuffType.java: -------------------------------------------------------------------------------- 1 | package com.game.buff.handler; 2 | 3 | /** 4 | * @ClassName BuffType 5 | * @Description buff类型 6 | * @Author DELL 7 | * @Date 2019/8/14 18:12 8 | * @Version 1.0 9 | */ 10 | public enum BuffType { 11 | /** 12 | * 13 | */ 14 | RED, 15 | BLUE, 16 | ATTACK, 17 | DEFEND; 18 | 19 | 20 | public static BuffType getBuffType(String s) { 21 | for (BuffType e: BuffType.values() ) { 22 | if (e.toString().equals(s)) { 23 | return e; 24 | } 25 | } 26 | return RED; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/game/buff/manager/AttackBuff.java: -------------------------------------------------------------------------------- 1 | package com.game.buff.manager; 2 | 3 | import com.game.buff.bean.ConcreteBuff; 4 | import com.game.role.bean.ConcreteRole; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @ClassName AttackBuff 9 | * @Description 攻击buff 10 | * @Author DELL 11 | * @Date 2019/9/5 18:06 12 | * @Version 1.0 13 | */ 14 | @Component 15 | public class AttackBuff implements IBuff { 16 | @Override 17 | public void executeBuff(ConcreteBuff buff, ConcreteRole role) { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/game/buff/manager/IBuff.java: -------------------------------------------------------------------------------- 1 | package com.game.buff.manager; 2 | 3 | import com.game.buff.bean.ConcreteBuff; 4 | import com.game.role.bean.ConcreteRole; 5 | 6 | public interface IBuff { 7 | public void executeBuff(ConcreteBuff buff, ConcreteRole role); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/game/client/ClientHandler.java: -------------------------------------------------------------------------------- 1 | package com.game.client; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.channel.SimpleChannelInboundHandler; 5 | 6 | /** 7 | * @ClassName ClientHandler 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/5/2712:33 11 | * @Version 1.0 12 | */ 13 | public class ClientHandler extends SimpleChannelInboundHandler { 14 | @Override 15 | public void channelActive(ChannelHandlerContext ctx) throws Exception { 16 | System.out.println(ctx.channel().remoteAddress().toString()); 17 | } 18 | 19 | @Override 20 | protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception { 21 | System.out.println(msg); 22 | if(msg.contains("下线了")){ 23 | System.exit(0); 24 | } 25 | } 26 | 27 | @Override 28 | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { 29 | cause.printStackTrace(); 30 | ctx.close(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/game/client/ClientInitializer.java: -------------------------------------------------------------------------------- 1 | package com.game.client; 2 | 3 | import io.netty.channel.ChannelInitializer; 4 | import io.netty.channel.ChannelPipeline; 5 | import io.netty.channel.socket.SocketChannel; 6 | import io.netty.handler.codec.string.StringDecoder; 7 | import io.netty.handler.codec.string.StringEncoder; 8 | import io.netty.util.CharsetUtil; 9 | 10 | /** 11 | * @ClassName ClientInitializer 12 | * @Description TODO 13 | * @Author DELL 14 | * @Date 2019/5/2712:30 15 | * @Version 1.0 16 | */ 17 | public class ClientInitializer extends ChannelInitializer { 18 | @Override 19 | protected void initChannel(SocketChannel ch) throws Exception { 20 | ChannelPipeline pipeline = ch.pipeline(); 21 | pipeline.addLast("stringDecoder",new StringDecoder(CharsetUtil.UTF_8)); 22 | pipeline.addLast("stringEncoder",new StringEncoder(CharsetUtil.UTF_8)); 23 | pipeline.addLast("clientHandler",new ClientHandler()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/game/dispatcher/ClassAndMethodDTO.java: -------------------------------------------------------------------------------- 1 | package com.game.dispatcher; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.reflect.Method; 6 | 7 | /** 8 | * @ClassName ClassAndMethodDTO 9 | * @Description 这个类只是一个包装类 10 | * @Author DELL 11 | * @Date 2019/5/2815:20 12 | * @Version 1.0 13 | */ 14 | @SuppressWarnings("rawtypes") 15 | @Component 16 | public class ClassAndMethodDTO { 17 | private Class clz; 18 | private Method method; 19 | public Class getClz() { 20 | return clz; 21 | } 22 | public void setClz(Class clz) { 23 | this.clz = clz; 24 | } 25 | public Method getMethod() { 26 | return method; 27 | } 28 | public void setMethod(Method method) { 29 | this.method = method; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/game/dispatcher/DataCodeor.java: -------------------------------------------------------------------------------- 1 | package com.game.dispatcher; 2 | 3 | /** 4 | * @ClassName DataCodeor 5 | * @Description 编码器、解码器 6 | * @Author DELL 7 | * @Date 2019/5/2815:06 8 | * @Version 1.0 9 | */ 10 | public class DataCodeor { 11 | /** 12 | * 加密 具体实现后面再写 13 | * @param str 14 | * @return 15 | */ 16 | public static String enCodeor(String str) { 17 | return str; 18 | } 19 | /** 20 | * 解密 21 | * @param str 22 | * @return 23 | */ 24 | public static String deCodeor(String str) { 25 | return str; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/game/dispatcher/RequestAnnotation.java: -------------------------------------------------------------------------------- 1 | package com.game.dispatcher; /** 2 | @Target 不指定Target代表可以在任何地方可以添加此注解 但是使用时只在类上和方法上使用 模拟Springmvc的RequeMapping 3 | */ 4 | 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | /** 10 | * 自定义注解类 用来标记控制器类 11 | * @Target 不指定Target代表可以在任何地方可以添加此注解 但是使用时只在类上和方法上使用 模拟Springmvc的RequeMapping 12 | */ 13 | @Component 14 | @Retention(RetentionPolicy.RUNTIME) 15 | public @interface RequestAnnotation { 16 | /** 17 | * 资源名 18 | * @return 19 | */ 20 | String value();//只有一个字段 用来接收用户请求的资源 资源类似 /user/login 格式 21 | } -------------------------------------------------------------------------------- /src/main/java/com/game/dispatcher/StringUtil.java: -------------------------------------------------------------------------------- 1 | package com.game.dispatcher; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * 验证字符串非空 7 | */ 8 | @Component 9 | public class StringUtil { 10 | public static boolean isNotNullOrEmpty(String str) { 11 | return str!=null&&!"".equals(str.trim()); 12 | } 13 | } -------------------------------------------------------------------------------- /src/main/java/com/game/duplicate/manager/RoleAndMap.java: -------------------------------------------------------------------------------- 1 | package com.game.duplicate.manager; 2 | 3 | import com.game.map.bean.ConcreteMap; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @ClassName RoleAndMap 10 | * @Description Role-map 11 | * @Author DELL 12 | * @Date 2019/8/26 11:22 13 | * @Version 1.0 14 | */ 15 | public class RoleAndMap { 16 | /** 17 | * 当前血量 18 | */ 19 | public static volatile Integer varHp = 0; 20 | /** 21 | * key:roleName 22 | * value:map 23 | */ 24 | private static volatile Map map = new HashMap<>(); 25 | 26 | private RoleAndMap(){} 27 | 28 | public static Map getRoleAndMap(){ 29 | return map; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/equipment/mapper/EquipmentMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.equipment.mapper; 2 | 3 | import com.game.equipment.bean.EquipmentBox; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | /** 7 | * @ClassName EquipmentMapper 8 | * @Description 装备mapper 9 | * @Author DELL 10 | * @Date 2019/6/19 12:13 11 | * @Version 1.0 12 | */ 13 | public interface EquipmentMapper { 14 | /** 15 | * 添加装备到装备栏 16 | * @param roleId 角色id 17 | * @param equipmentPart 装备 18 | */ 19 | public void insertEquipment(@Param("roleId") int roleId, @Param("equipmentPart") String equipmentPart); 20 | 21 | /** 22 | * 修改装备 23 | * @param roleId 角色id 24 | * @param equipmentPart 装备 25 | */ 26 | public void updateEquipment(@Param("roleId") int roleId, @Param("equipmentPart") String equipmentPart); 27 | 28 | /** 29 | * 查找装备 30 | * @param roleId 角色id 31 | * @return 装备栏 32 | */ 33 | public EquipmentBox getEquipment(int roleId); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/annotation/EventAnnotation.java: -------------------------------------------------------------------------------- 1 | package com.game.event.annotation; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | * 标记接口,标记事件 10 | */ 11 | @Component 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface EventAnnotation { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/beanevent/AttackedEvent.java: -------------------------------------------------------------------------------- 1 | package com.game.event.beanevent; 2 | 3 | import com.game.event.annotation.EventAnnotation; 4 | import com.game.event.core.IEvent; 5 | import com.game.role.bean.ConcreteRole; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * @ClassName AttackedEvent 10 | * @Description 被攻击事件 11 | * @Author DELL 12 | * @Date 2019/8/14 18:41 13 | * @Version 1.0 14 | */ 15 | @Component 16 | @EventAnnotation 17 | public class AttackedEvent extends IEvent { 18 | /** 19 | * 角色 20 | */ 21 | private ConcreteRole role; 22 | 23 | public void setRole(ConcreteRole role) { 24 | this.role = role; 25 | } 26 | 27 | @Override 28 | public ConcreteRole getRole() { 29 | return role; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/beanevent/GoVillageEvent.java: -------------------------------------------------------------------------------- 1 | package com.game.event.beanevent; 2 | 3 | import com.game.event.annotation.EventAnnotation; 4 | import com.game.event.core.IEvent; 5 | import com.game.role.bean.ConcreteRole; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * @ClassName GoVillageHandler 10 | * @Description 回村子事件 11 | * @Author DELL 12 | * @Date 2019/8/22 10:31 13 | * @Version 1.0 14 | */ 15 | @Component 16 | @EventAnnotation 17 | public class GoVillageEvent extends IEvent { 18 | /** 19 | * 角色 20 | */ 21 | private ConcreteRole role; 22 | @Override 23 | public ConcreteRole getRole() { 24 | return role; 25 | } 26 | 27 | public void setRole(ConcreteRole role) { 28 | this.role = role; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/beanevent/GoodsEvent.java: -------------------------------------------------------------------------------- 1 | package com.game.event.beanevent; 2 | 3 | import com.game.event.core.IEvent; 4 | import com.game.role.bean.ConcreteRole; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @ClassName GoodsEvent 9 | * @Description 物品事件 10 | * @Author DELL 11 | * @Date 2019/8/27 20:42 12 | * @Version 1.0 13 | */ 14 | @Component 15 | public class GoodsEvent extends IEvent { 16 | /** 17 | * 角色 18 | */ 19 | private ConcreteRole role; 20 | @Override 21 | public ConcreteRole getRole() { 22 | return role; 23 | } 24 | 25 | public void setRole(ConcreteRole role) { 26 | this.role = role; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/beanevent/TalkEvent.java: -------------------------------------------------------------------------------- 1 | package com.game.event.beanevent; 2 | 3 | import com.game.event.core.IEvent; 4 | import com.game.role.bean.ConcreteRole; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @ClassName TalkEvent 9 | * @Description 谈话事件 10 | * @Author DELL 11 | * @Date 2019/8/27 20:39 12 | * @Version 1.0 13 | */ 14 | @Component("prototype") 15 | public class TalkEvent extends IEvent { 16 | /** 17 | * 角色 18 | */ 19 | private ConcreteRole role; 20 | @Override 21 | public ConcreteRole getRole() { 22 | return role; 23 | } 24 | 25 | public void setRole(ConcreteRole role) { 26 | this.role = role; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/beanevent/TradeEvent.java: -------------------------------------------------------------------------------- 1 | package com.game.event.beanevent; 2 | 3 | import com.game.event.core.IEvent; 4 | import com.game.role.bean.ConcreteRole; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @ClassName TradeEvent 9 | * @Description 交易事件 10 | * @Author DELL 11 | * @Date 2019/8/27 20:42 12 | * @Version 1.0 13 | */ 14 | @Component 15 | public class TradeEvent extends IEvent { 16 | /** 17 | * 角色 18 | */ 19 | private ConcreteRole role; 20 | @Override 21 | public ConcreteRole getRole() { 22 | return role; 23 | } 24 | 25 | public void setRole(ConcreteRole role) { 26 | this.role = role; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/core/EventBusManager.java: -------------------------------------------------------------------------------- 1 | package com.game.event.core; 2 | 3 | import com.game.event.handler.IHandler; 4 | import com.game.role.bean.ConcreteRole; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * @ClassName EventBusManager 13 | * @Description 事件管理器 14 | * @Author DELL 15 | * @Date 2019/7/24 18:19 16 | * @Version 1.0 17 | */ 18 | @Component 19 | public class EventBusManager implements IEventBusManager { 20 | /** 21 | * 事件map 22 | */ 23 | private static Map, List> eventMap = new HashMap<>(); 24 | 25 | /** 26 | * 事件容器map 27 | * @return 28 | */ 29 | public static Map, List> getEventMap(){ 30 | return eventMap; 31 | } 32 | @Override 33 | public void synSubmit(IEvent event, ConcreteRole role) { 34 | 35 | } 36 | 37 | @Override 38 | public void asynSubmit(IEvent event, ConcreteRole role) { 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/core/IEvent.java: -------------------------------------------------------------------------------- 1 | package com.game.event.core; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @ClassName IEvent 8 | * @Description 事件标记类 9 | * @Author DELL 10 | * @Date 2019/7/23 10:53 11 | * @Version 1.0 12 | */ 13 | @Component 14 | public abstract class IEvent { 15 | public abstract ConcreteRole getRole(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/core/IEventBusManager.java: -------------------------------------------------------------------------------- 1 | package com.game.event.core; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | 5 | /** 6 | * @ClassName IEventBusManager 7 | * @Description 事件管理器接口 8 | * @Author DELL 9 | * @Date 2019/7/24 18:18 10 | * @Version 1.0 11 | */ 12 | public interface IEventBusManager { 13 | /** 14 | * 同步 15 | * @param event 16 | * @param role 17 | */ 18 | public void synSubmit(IEvent event, ConcreteRole role); 19 | 20 | /** 21 | * 异步 22 | * @param event 23 | * @param role 24 | */ 25 | public void asynSubmit(IEvent event,ConcreteRole role); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/handler/AttackedHandler.java: -------------------------------------------------------------------------------- 1 | package com.game.event.handler; 2 | 3 | import com.game.event.annotation.EventAnnotation; 4 | import com.game.event.beanevent.AttackedEvent; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @ClassName AttackedHandler 9 | * @Description 被攻击处理器 10 | * @Author DELL 11 | * @Date 2019/8/14 20:27 12 | * @Version 1.0 13 | */ 14 | @EventAnnotation 15 | @Component 16 | public class AttackedHandler implements IHandler { 17 | /** 18 | * 执行处理器 19 | * @param attackedEvent 被攻击事件 20 | */ 21 | @EventAnnotation 22 | @Override 23 | public void exec(AttackedEvent attackedEvent) { 24 | //取消buff 25 | CancleBuff.cancleBuffMethod(attackedEvent); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/handler/CancleBuff.java: -------------------------------------------------------------------------------- 1 | package com.game.event.handler; 2 | 3 | import com.game.event.core.IEvent; 4 | import com.game.role.bean.ConcreteRole; 5 | import io.netty.util.concurrent.Future; 6 | 7 | /** 8 | * @ClassName CancleBuff 9 | * @Description 取消buff 10 | * @Author DELL 11 | * @Date 2019/8/22 10:38 12 | * @Version 1.0 13 | */ 14 | public class CancleBuff { 15 | /** 16 | * 取消Buff 17 | * @param event event 18 | */ 19 | public static void cancleBuffMethod(IEvent event){ 20 | ConcreteRole role = event.getRole(); 21 | //根据TaskMap和TaskQueue找到对应的buff 22 | if(role.getTaskMap()==null){ 23 | return; 24 | } 25 | Future future = role.getTaskMap().get(String.valueOf(role.getId())); 26 | //除去buff 27 | // role.getMapBuff().remove(role.getBuff().getName()); 28 | //取消buff 29 | if(future!=null){ 30 | future.cancel(true); 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/handler/GoVillageHandler.java: -------------------------------------------------------------------------------- 1 | package com.game.event.handler; 2 | 3 | import com.game.event.annotation.EventAnnotation; 4 | import com.game.event.beanevent.GoVillageEvent; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @ClassName GoVillageHandler 9 | * @Description 回村事件 10 | * @Author DELL 11 | * @Date 2019/8/22 10:32 12 | * @Version 1.0 13 | */ 14 | @EventAnnotation 15 | @Component 16 | public class GoVillageHandler implements IHandler { 17 | @EventAnnotation 18 | @Override 19 | public void exec(GoVillageEvent goVillageEvent) { 20 | //取消buff 21 | CancleBuff.cancleBuffMethod(goVillageEvent); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/handler/IHandler.java: -------------------------------------------------------------------------------- 1 | package com.game.event.handler; 2 | 3 | import com.game.event.core.IEvent; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @ClassName IHandler 8 | * @Description 处理器接口 9 | * @Author DELL 10 | * @Date 2019/7/24 18:31 11 | * @Version 1.0 12 | */ 13 | @Component 14 | public interface IHandler { 15 | /** 16 | * 执行方法 17 | * @param e e 18 | */ 19 | public abstract void exec(E e); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/handler/TalkHandler.java: -------------------------------------------------------------------------------- 1 | package com.game.event.handler; 2 | 3 | import com.game.event.annotation.EventAnnotation; 4 | import com.game.event.beanevent.TalkEvent; 5 | import com.game.utils.QuestType; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * @ClassName TalkHandler 11 | * @Description 谈话处理器 12 | * @Author DELL 13 | * @Date 2019/8/27 20:41 14 | * @Version 1.0 15 | */ 16 | @EventAnnotation 17 | @Component 18 | public class TalkHandler implements IHandler { 19 | /** 20 | * 处理器工具类 21 | */ 22 | @Autowired 23 | private HandlerUtils handlerUtils; 24 | 25 | @EventAnnotation 26 | @Override 27 | public void exec(TalkEvent talkEvent) { 28 | //处理任务 29 | handlerUtils.handleTask(talkEvent, QuestType.TALK); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/handler/Trade2Handler.java: -------------------------------------------------------------------------------- 1 | package com.game.event.handler; 2 | 3 | import com.game.event.annotation.EventAnnotation; 4 | import com.game.event.beanevent.TradeEvent; 5 | import com.game.utils.QuestType; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * @ClassName TradeHandler 11 | * @Description 交易处理器 12 | * @Author DELL 13 | * @Date 2019/8/27 20:44 14 | * @Version 1.0 15 | */ 16 | @EventAnnotation 17 | @Component 18 | public class Trade2Handler implements IHandler{ 19 | /** 20 | * 处理器工具类 21 | */ 22 | @Autowired 23 | private HandlerUtils handlerUtils; 24 | @EventAnnotation 25 | @Override 26 | public void exec(TradeEvent tradeEvent) { 27 | //处理任务 28 | handlerUtils.handleTask(tradeEvent, QuestType.TRADE); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/handler/UseGoodsHandler.java: -------------------------------------------------------------------------------- 1 | package com.game.event.handler; 2 | 3 | import com.game.event.annotation.EventAnnotation; 4 | import com.game.event.beanevent.GoodsEvent; 5 | import com.game.utils.QuestType; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * @ClassName GoodsHandler 11 | * @Description 物品处理器 12 | * @Author DELL 13 | * @Date 2019/8/27 20:45 14 | * @Version 1.0 15 | */ 16 | @EventAnnotation 17 | @Component 18 | public class UseGoodsHandler implements IHandler { 19 | /** 20 | * 处理器工具类 21 | */ 22 | @Autowired 23 | private HandlerUtils handlerUtils; 24 | @EventAnnotation 25 | @Override 26 | public void exec(GoodsEvent goodsEvent) { 27 | //处理任务 28 | handlerUtils.handleTask(goodsEvent, QuestType.USEGOODS); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/manager/EventTaskMap.java: -------------------------------------------------------------------------------- 1 | package com.game.event.manager; 2 | 3 | import com.game.event.core.IEvent; 4 | import com.game.task.bean.ConcreteTask; 5 | 6 | import java.util.HashMap; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * @ClassName EventTaskMap 12 | * @Description 事件和任务的容器 13 | * @Author DELL 14 | * @Date 2019/7/29 16:41 15 | * @Version 1.0 16 | */ 17 | public class EventTaskMap { 18 | /** 19 | * 事件和任务的容器map 20 | */ 21 | private static volatile Map, List> eventTaskMap = new HashMap<>(); 22 | private EventTaskMap(){} 23 | 24 | public static Map, List> getEventTaskMap(){ 25 | return eventTaskMap; 26 | } 27 | 28 | public void register(IEvent event) { 29 | Class aClass = event.getClass(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/event/task/RecoveryMonsterTask.java: -------------------------------------------------------------------------------- 1 | package com.game.event.task; 2 | 3 | 4 | import com.game.npc.bean.ConcreteMonster; 5 | import com.game.role.bean.ConcreteRole; 6 | 7 | /** 8 | * @ClassName RecoveryMonsterTask 9 | * @Description 怪兽复活 10 | * @Author DELL 11 | * @Date 2019/8/22 22:13 12 | * @Version 1.0 13 | */ 14 | public class RecoveryMonsterTask implements Runnable { 15 | /** 16 | * 怪兽 17 | */ 18 | private ConcreteMonster monster; 19 | /** 20 | * 角色 21 | */ 22 | private ConcreteRole role; 23 | public RecoveryMonsterTask(ConcreteMonster monster,ConcreteRole role) { 24 | this.monster = monster; 25 | this.role = role; 26 | } 27 | 28 | @Override 29 | public void run() { 30 | //怪兽复活 31 | monster.setHp(500); 32 | // 33 | role.getQueue().remove(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/bean/GangMemberEntity.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.bean; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | 5 | /** 6 | * @ClassName GangMemberEntity 7 | * @Description 工会成员 8 | * @Author DELL 9 | * @Date 2019/7/16 11:58 10 | * @Version 1.0 11 | */ 12 | public class GangMemberEntity { 13 | /** 14 | * 角色 15 | */ 16 | private ConcreteRole role; 17 | /** 18 | * 工会 19 | */ 20 | private GangEntity gang; 21 | /** 22 | * 职位 23 | */ 24 | private String job; 25 | 26 | public ConcreteRole getRole() { 27 | return role; 28 | } 29 | 30 | public void setRole(ConcreteRole role) { 31 | this.role = role; 32 | } 33 | 34 | public GangEntity getGang() { 35 | return gang; 36 | } 37 | 38 | public void setGang(GangEntity gang) { 39 | this.gang = gang; 40 | } 41 | 42 | public String getJob() { 43 | return job; 44 | } 45 | 46 | public void setJob(String job) { 47 | this.job = job; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/bean/Job.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.bean; 2 | 3 | /** 4 | * @ClassName Job 5 | * @Description 职位 6 | * @Author DELL 7 | * @Date 2019/7/16 12:12 8 | * @Version 1.0 9 | */ 10 | public enum Job { 11 | /** 12 | * 工会会长 13 | */ 14 | CHARIMEN("会长"), 15 | /** 16 | * 副会长 17 | */ 18 | VICE_CHARIMEN("副会长"), 19 | /** 20 | * 精英 21 | */ 22 | ELITE("精英"), 23 | /** 24 | * 普通成员 25 | */ 26 | GENERAL("普通成员"); 27 | /** 28 | * 职位 29 | */ 30 | private String name; 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | Job(String name){ 41 | this.name = name; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/bean/JobPermission.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.bean; 2 | 3 | public enum JobPermission { 4 | /** 5 | * 工会职业权限 6 | */ 7 | HANDLE_APPLICATION("处理申请"), 8 | /** 9 | * 踢人 10 | */ 11 | KICK("踢人"), 12 | /** 13 | * 退出 14 | */ 15 | EXIT("退出"), 16 | /** 17 | * 解散 18 | */ 19 | DISMISS("解散"); 20 | 21 | /** 22 | * 功能名字 23 | */ 24 | String name; 25 | JobPermission(String name){ 26 | this.name = name; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/bean/JobResource.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.bean; 2 | 3 | /** 4 | * @ClassName JobResource 5 | * @Description 职位 6 | * @Author DELL 7 | * @Date 2019/7/16 14:20 8 | * @Version 1.0 9 | */ 10 | public class JobResource { 11 | /** 12 | * 职位Id 13 | */ 14 | private Integer id; 15 | /** 16 | * 职位 17 | */ 18 | private String job; 19 | /** 20 | * 职位权限 21 | */ 22 | private String permission; 23 | 24 | public Integer getId() { 25 | return id; 26 | } 27 | 28 | public void setId(Integer id) { 29 | this.id = id; 30 | } 31 | 32 | public String getJob() { 33 | return job; 34 | } 35 | 36 | public void setJob(String job) { 37 | this.job = job; 38 | } 39 | 40 | public String getPermission() { 41 | return permission; 42 | } 43 | 44 | public void setPermission(String permission) { 45 | this.permission = permission; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/manager/JobPermissionMap.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.manager; 2 | 3 | import com.game.gang.bean.JobResource; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @ClassName JobPermissionMap 10 | * @Description 职位-职位权限 11 | * @Author DELL 12 | * @Date 2019/7/16 14:57 13 | * @Version 1.0 14 | */ 15 | public class JobPermissionMap { 16 | /** 17 | * 职位和职位权限容器map 18 | */ 19 | private static volatile Map jobPermissionMap = null; 20 | 21 | private JobPermissionMap(){} 22 | 23 | public static Map getJobPermissionMap(){ 24 | if(jobPermissionMap==null){ 25 | synchronized (JobPermissionMap.class){ 26 | if(jobPermissionMap==null){ 27 | jobPermissionMap = new HashMap<>(); 28 | } 29 | } 30 | } 31 | return jobPermissionMap; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/mapper/GangEntityMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.mapper; 2 | 3 | import com.game.gang.bean.GangEntity; 4 | 5 | /** 6 | * @ClassName GangEntityMapper 7 | * @Description 工会mapper 8 | * @Author DELL 9 | * @Date 2019/7/17 10:49 10 | * @Version 1.0 11 | */ 12 | public interface GangEntityMapper { 13 | /** 14 | * 插入工会 15 | * @param gangName 工会名称 16 | */ 17 | public void insertGang(String gangName); 18 | 19 | /** 20 | * 查询工会(名字) 21 | * @param gangName 工会名 22 | * @return 工会 23 | */ 24 | public GangEntity queryGang(String gangName); 25 | 26 | /** 27 | * 通过角色查询工会 28 | * @param roleId 角色id 29 | * @return 30 | */ 31 | public GangEntity queryGangByRoleName(Integer roleId); 32 | /** 33 | * 更新工会 34 | * @param gangEntity 工会 35 | */ 36 | public void updateGangEntity(GangEntity gangEntity); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/mapper/GangMemberEntityMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.mapper; 2 | 3 | import com.game.gang.bean.GangMemberEntity; 4 | 5 | public interface GangMemberEntityMapper { 6 | /** 7 | * 查询工会成员 8 | * @param roleId 角色id 9 | * @return 工会成员 10 | */ 11 | public GangMemberEntity findGangMember(Integer roleId); 12 | 13 | /** 14 | * 添加工会成员 15 | * @param entity 插入工会成员 16 | */ 17 | public void insertGangMember(GangMemberEntity entity); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/game/gang/task/InsertGangTask.java: -------------------------------------------------------------------------------- 1 | package com.game.gang.task; 2 | 3 | import com.game.gang.mapper.GangEntityMapper; 4 | import com.game.utils.SqlUtils; 5 | import org.apache.ibatis.session.SqlSession; 6 | 7 | import java.util.concurrent.Callable; 8 | 9 | /** 10 | * @ClassName InsertGangTask 11 | * @Description 添加工会任务器 12 | * @Author DELL 13 | * @Date 2019/8/19 20:10 14 | * @Version 1.0 15 | */ 16 | public class InsertGangTask implements Callable { 17 | /** 18 | * 工会名字 19 | */ 20 | private String gangName; 21 | 22 | public InsertGangTask(String gangName) { 23 | this.gangName = gangName; 24 | } 25 | 26 | @Override 27 | public Object call() throws Exception { 28 | SqlSession session = SqlUtils.getSession(); 29 | try { 30 | GangEntityMapper mapper = session.getMapper(GangEntityMapper.class); 31 | mapper.insertGang(gangName); 32 | session.commit(); 33 | }finally { 34 | session.close(); 35 | } 36 | return null; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/game/map/manager/MapFactory.java: -------------------------------------------------------------------------------- 1 | package com.game.map.manager; 2 | 3 | import com.game.map.bean.ConcreteMap; 4 | 5 | /** 6 | * @ClassName MapFactory 7 | * @Description 地图工厂 8 | * @Author DELL 9 | * @Date 2019/9/6 18:19 10 | * @Version 1.0 11 | */ 12 | public class MapFactory { 13 | public static ConcreteMap createMap(int id, String name){ 14 | return new ConcreteMap(id,name); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/game/map/mapper/MapMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.map.mapper; 2 | 3 | import com.game.map.bean.ConcreteMap; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @ClassName MapMapper 9 | * @Description 地图mapper 10 | * @Author DELL 11 | * @Date 2019/5/2921:03 12 | * @Version 1.0 13 | */ 14 | public interface MapMapper { 15 | public void updateMap(ConcreteMap map); 16 | /** 17 | * 获取地图所有信息 18 | * @return 信息 19 | */ 20 | public List getMapMsg(); 21 | /** 22 | * 根据地图id获取 23 | * @param id id 24 | * @return map 25 | */ 26 | public ConcreteMap getMapById(int id); 27 | 28 | /** 29 | * 根据地图名字获取地图id 30 | * @param name 地图名 31 | * @return the id of map 32 | */ 33 | public Integer getIdByName(String name); 34 | 35 | /** 36 | * 根据roleId获取地图 37 | * @param roleId the id of role 38 | * @return map 39 | */ 40 | public ConcreteMap getMapByRoleId(int roleId); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/game/map/threadpool/TaskQueue.java: -------------------------------------------------------------------------------- 1 | package com.game.map.threadpool; 2 | 3 | import java.util.Queue; 4 | import java.util.concurrent.ArrayBlockingQueue; 5 | 6 | /** 7 | * @ClassName TaskQueue 8 | * @Description 任务队列 9 | * @Author DELL 10 | * @Date 2019/7/8 17:12 11 | * @Version 1.0 12 | */ 13 | public class TaskQueue { 14 | /** 15 | * 任务队列 16 | */ 17 | private volatile Queue queue; 18 | 19 | private TaskQueue(){} 20 | 21 | /** 22 | * 返回任务队列对象 23 | * @return 对象 24 | */ 25 | public static Queue getQueue(){ 26 | return new ArrayBlockingQueue(20); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/game/notice/NoticeBean.java: -------------------------------------------------------------------------------- 1 | package com.game.notice; 2 | 3 | import com.game.npc.bean.ConcreteMonster; 4 | 5 | /** 6 | * @ClassName NoticeBean 7 | * @Description 通知 8 | * @Author DELL 9 | * @Date 2019/6/14 16:37 10 | * @Version 1.0 11 | */ 12 | public class NoticeBean { 13 | /** 14 | * 通知类型 15 | */ 16 | private String type; 17 | /** 18 | * 角色名字 19 | */ 20 | private String roleName; 21 | /** 22 | * 怪兽 23 | */ 24 | private ConcreteMonster monster; 25 | 26 | public String getType() { 27 | return type; 28 | } 29 | 30 | public void setType(String type) { 31 | this.type = type; 32 | } 33 | 34 | public String getRoleName() { 35 | return roleName; 36 | } 37 | 38 | public void setRoleName(String roleName) { 39 | this.roleName = roleName; 40 | } 41 | 42 | public ConcreteMonster getMonster() { 43 | return monster; 44 | } 45 | 46 | public void setMonster(ConcreteMonster monster) { 47 | this.monster = monster; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/game/npc/bean/ConcreteNPC.java: -------------------------------------------------------------------------------- 1 | package com.game.npc.bean; 2 | 3 | /** 4 | * @ClassName ConcreteNPC 5 | * @Description NPC实体类 6 | * @Author DELL 7 | * @Date 2019/6/11 10:54 8 | * @Version 1.0 9 | */ 10 | public class ConcreteNPC { 11 | /** 12 | * 唯一id 13 | */ 14 | private Integer id; 15 | /** 16 | * NPC名字 17 | */ 18 | private String name; 19 | /** 20 | * NPC的说话内容 21 | */ 22 | private String content; 23 | 24 | public Integer getId() { 25 | return id; 26 | } 27 | 28 | public void setId(Integer id) { 29 | this.id = id; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | public String getContent() { 41 | return content; 42 | } 43 | 44 | public void setContent(String content) { 45 | this.content = content; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/game/npc/bean/MapNPCMapping.java: -------------------------------------------------------------------------------- 1 | package com.game.npc.bean; 2 | 3 | /** 4 | * @ClassName MapNPCMapping 5 | * @Description 地图和NPC映射类 6 | * @Author DELL 7 | * @Date 2019/6/11 12:24 8 | * @Version 1.0 9 | */ 10 | public class MapNPCMapping { 11 | /** 12 | * 唯一id 13 | */ 14 | private Integer id; 15 | /** 16 | * 地图id 17 | */ 18 | private Integer mapId; 19 | /** 20 | * npcId 21 | */ 22 | private Integer npcId; 23 | 24 | public Integer getId() { 25 | return id; 26 | } 27 | 28 | public void setId(Integer id) { 29 | this.id = id; 30 | } 31 | 32 | public Integer getMapId() { 33 | return mapId; 34 | } 35 | 36 | public void setMapId(Integer mapId) { 37 | this.mapId = mapId; 38 | } 39 | 40 | public Integer getNpcId() { 41 | return npcId; 42 | } 43 | 44 | public void setNpcId(Integer npcId) { 45 | this.npcId = npcId; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/game/npc/bean/MonsterMapMapping.java: -------------------------------------------------------------------------------- 1 | package com.game.npc.bean; 2 | 3 | /** 4 | * @ClassName MonsterMapMapping 5 | * @Description 怪物-地图映射实体类 6 | * @Author DELL 7 | * @Date 2019/6/11 17:46 8 | * @Version 1.0 9 | */ 10 | public class MonsterMapMapping { 11 | /** 12 | * 唯一id 13 | */ 14 | private Integer id; 15 | /** 16 | * 怪兽id 17 | */ 18 | private Integer monsterId; 19 | /** 20 | * 地图id 21 | */ 22 | private Integer mapId; 23 | 24 | public Integer getId() { 25 | return id; 26 | } 27 | 28 | public void setId(Integer id) { 29 | this.id = id; 30 | } 31 | 32 | public Integer getMonsterId() { 33 | return monsterId; 34 | } 35 | 36 | public void setMonsterId(Integer monsterId) { 37 | this.monsterId = monsterId; 38 | } 39 | 40 | public Integer getMapId() { 41 | return mapId; 42 | } 43 | 44 | public void setMapId(Integer mapId) { 45 | this.mapId = mapId; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/game/occupation/manager/OccupationMap.java: -------------------------------------------------------------------------------- 1 | package com.game.occupation.manager; 2 | 3 | import com.game.occupation.bean.Occupation; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @ClassName OccupationMap 10 | * @Description 职业map 11 | * @Author DELL 12 | * @Date 2019/7/3 15:27 13 | * @Version 1.0 14 | */ 15 | public class OccupationMap { 16 | /** 17 | * 职业容器map 18 | */ 19 | private static volatile Map occupationMap = null; 20 | private OccupationMap(){} 21 | 22 | /** 23 | * 获取职业容器map 24 | * @return map 25 | */ 26 | public static Map getOccupationMap(){ 27 | if(occupationMap==null){ 28 | synchronized (OccupationMap.class){ 29 | if (occupationMap==null){ 30 | occupationMap = new HashMap<>(); 31 | } 32 | } 33 | } 34 | return occupationMap; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/game/property/bean/Property.java: -------------------------------------------------------------------------------- 1 | package com.game.property.bean; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @ClassName Property 8 | * @Description 属性实体类 9 | * @Author DELL 10 | * @Date 2019/6/20 21:34 11 | * @Version 1.0 12 | */ 13 | @Component 14 | public class Property { 15 | /** 16 | * id 17 | */ 18 | private Integer id; 19 | /** 20 | * property 21 | */ 22 | private JSONObject propertyJson; 23 | 24 | public Integer getId() { 25 | return id; 26 | } 27 | 28 | public void setId(Integer id) { 29 | this.id = id; 30 | } 31 | 32 | public JSONObject getPropertyJson() { 33 | return propertyJson; 34 | } 35 | 36 | public void setPropertyJson(JSONObject propertyJson) { 37 | this.propertyJson = propertyJson; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/game/property/bean/PropertyType.java: -------------------------------------------------------------------------------- 1 | package com.game.property.bean; 2 | 3 | import java.util.Arrays; 4 | import java.util.Map; 5 | import java.util.concurrent.ConcurrentHashMap; 6 | 7 | /** 8 | * @ClassName PropertyType 9 | * @Description 属性类型 10 | * @Author DELL 11 | * @Date 2019/6/24 18:03 12 | * @Version 1.0 13 | */ 14 | public enum PropertyType { 15 | 16 | 17 | /** 18 | * HP:血量 19 | * MP:魔法值 20 | * ATTACK:攻击力 21 | * DEFEND:防御力 22 | */ 23 | HP("hp"),MP("mp"),ATTACK("attack"),DEFEND("defend"); 24 | 25 | String name; 26 | public static Map map = new ConcurrentHashMap<>(); 27 | 28 | PropertyType(String name) { 29 | this.name = name; 30 | } 31 | 32 | static { 33 | 34 | Arrays.stream(PropertyType.values()) 35 | .forEach( 36 | e -> map.put(e.name,e) 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/game/property/manager/PropertyManager.java: -------------------------------------------------------------------------------- 1 | package com.game.property.manager; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.game.property.bean.PropertyType; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * @ClassName PropertyManager 11 | * @Description 12 | * @Author DELL 13 | * @Date 2019/6/20 21:36 14 | * @Version 1.0 15 | */ 16 | public class PropertyManager { 17 | 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/Goods.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | //protoc --java_out=src\main\java src\main\java\com\game\protobuf\Map.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "GoodsProto"; 7 | 8 | message Goods{ 9 | int32 id = 1; 10 | string name = 2; 11 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/Map.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | //protoc --java_out=src\main\java src\main\java\com\game\protobuf\Map.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MapProto"; 7 | 8 | message Map{ 9 | int32 id = 1; 10 | string name = 2; 11 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgAuctionInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgAuctionInfoProto"; 7 | 8 | enum RequestType{ 9 | BIDDING = 0; 10 | RECYCLE = 1; 11 | PUBLISH = 2; 12 | QUERYAUCTION = 3; 13 | } 14 | 15 | message RequestAuctionInfo{ 16 | string requestId = 1; // 请求id 17 | int32 userId = 2; // 请求的uid 18 | string auctionId = 3; //目的地 19 | RequestType type = 4; // 请求类型 20 | string money = 5; 21 | string goodsName = 6; 22 | string number = 7; 23 | string isNow = 8; 24 | } 25 | 26 | message ResponseAuctionInfo{ 27 | int32 result = 1; // 返回结果 28 | int32 userId = 2; // 返回的uid 29 | string content = 3; // 返回内容 30 | 31 | RequestType type = 4; // 返回类型 32 | 33 | Role role = 5; // 用户角色 34 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgChatInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgChatInfoProto"; 7 | 8 | enum RequestType{ 9 | CHATALL = 0; 10 | CHATSOMEONE = 1; 11 | } 12 | 13 | message RequestChatInfo{ 14 | string requestId = 1; // 请求id 15 | int32 userId = 2; // 请求的uid 16 | string target = 3; //目标对象 17 | string content = 4; //内容 18 | RequestType type = 5; // 请求类型 19 | } 20 | 21 | message ResponseChatInfo{ 22 | int32 result = 1; // 返回结果 23 | int32 userId = 2; // 返回的uid 24 | string content = 3; // 返回内容 25 | 26 | RequestType type = 4; // 返回类型 27 | 28 | Role role = 5; // 用户角色 29 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgEmailInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgEmailInfoProto"; 7 | 8 | enum RequestType{ 9 | SENDGOODS = 0; 10 | } 11 | 12 | message RequestEmailInfo{ 13 | string requestId = 1; // 请求id 14 | int32 userId = 2; // 请求的uid 15 | string goodsName = 3; //目的地 16 | RequestType type = 4; // 请求类型 17 | } 18 | 19 | message ResponseEmailInfo{ 20 | int32 result = 1; // 返回结果 21 | int32 userId = 2; // 返回的uid 22 | string content = 3; // 返回内容 23 | 24 | RequestType type = 4; // 返回类型 25 | 26 | Role role = 5; // 用户角色 27 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgEquipInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgEquipInfoProto"; 7 | 8 | enum RequestType{ 9 | ADDEQUIP = 0; //添加装备 10 | REMOVEEQUIP = 1; //卸掉装备 11 | SHOWEQUIP = 2; //展示装备 12 | } 13 | 14 | message RequestEquipInfo{ 15 | string requestId = 1; // 请求id 16 | int32 userId = 2; // 请求的uid 17 | string goodsName = 3; //物品名称 18 | RequestType type = 4; // 请求类型 19 | } 20 | 21 | message ResponseEquipInfo{ 22 | int32 result = 1; // 返回结果 23 | int32 userId = 2; // 返回的uid 24 | string content = 3; // 返回内容 25 | 26 | RequestType type = 4; // 返回类型 27 | 28 | Role role = 5; // 用户角色 29 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgGangInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgGangInfoProto"; 7 | 8 | enum RequestType{ 9 | CREATEGANG = 0; 10 | JOINGANG = 1; 11 | DISMISSGANG = 2; 12 | DONATEMONEY = 3; 13 | } 14 | 15 | message RequestGangInfo{ 16 | string requestId = 1; // 请求id 17 | int32 userId = 2; // 请求的uid 18 | string gangName = 3; //目的地 19 | RequestType type = 4; // 请求类型 20 | string number = 5; 21 | } 22 | 23 | message ResponseGangInfo{ 24 | int32 result = 1; // 返回结果 25 | int32 userId = 2; // 返回的uid 26 | string content = 3; // 返回内容 27 | 28 | RequestType type = 4; // 返回类型 29 | 30 | Role role = 5; // 用户角色 31 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgGoodsInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgGoodsInfoProto"; 7 | 8 | enum RequestType{ 9 | GETGOODS = 0; //获取物品 10 | DISCARDGOODS = 1; //丢掉物品 11 | SHOWGOODS = 2; //显示物品 12 | } 13 | 14 | message RequestGoodsInfo{ 15 | string requestId = 1; // 请求id 16 | int32 userId = 2; // 请求的uid 17 | string goodsName = 3; //物品名称 18 | RequestType type = 4; // 请求类型 19 | } 20 | 21 | message ResponseGoodsInfo{ 22 | int32 result = 1; // 返回结果 23 | int32 userId = 2; // 返回的uid 24 | string content = 3; // 返回内容 25 | 26 | RequestType type = 4; // 返回类型 27 | 28 | Role role = 5; // 用户角色 29 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgMapInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgMapInfoProto"; 7 | 8 | enum RequestType{ 9 | GETMAP = 0; //获取所在位置 10 | MOVE = 1; //移动 11 | } 12 | 13 | message RequestMapInfo{ 14 | string requestId = 1; // 请求id 15 | int32 userId = 2; // 请求的uid 16 | string dest = 3; //目的地 17 | RequestType type = 4; // 请求类型 18 | } 19 | 20 | message ResponseMapInfo{ 21 | int32 result = 1; // 返回结果 22 | int32 userId = 2; // 返回的uid 23 | string content = 3; // 返回内容 24 | 25 | RequestType type = 4; // 返回类型 26 | 27 | Role role = 5; // 用户角色 28 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgNpcInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | import "Npc.proto"; 4 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 5 | 6 | option java_package = "com.game.protobuf.protoc"; 7 | option java_outer_classname = "MsgNpcInfoProto"; 8 | enum RequestType{ 9 | TALKTONPC = 0; 10 | } 11 | 12 | message RequestNpcInfo{ 13 | string requestId = 1; // 请求id 14 | int32 userId = 2; // 请求的uid 15 | string npcName = 3; // npc名字 16 | RequestType type = 4; // 请求类型 17 | } 18 | 19 | message ResponseNpcInfo{ 20 | int32 result = 1; // 返回结果 21 | int32 userId = 2; // 返回的uid 22 | string content = 3; 23 | 24 | RequestType type = 4; // 返回类型 25 | 26 | Role role = 5; // 用户角色 27 | Npc npc = 6; // npc 28 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgRankInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgRankInfoProto"; 7 | 8 | enum RequestType{ 9 | QUERYRANK = 0; 10 | INSERTRANK = 1; 11 | DELETERANK = 2; 12 | UPDATERANK = 3; 13 | } 14 | 15 | message RequestRankInfo{ 16 | string requestId = 1; // 请求id 17 | int32 userId = 2; // 请求的uid 18 | RequestType type = 3; // 请求类型 19 | } 20 | 21 | message ResponseRankInfo{ 22 | int32 result = 1; // 返回结果 23 | int32 userId = 2; // 返回的uid 24 | string content = 3; // 返回内容 25 | 26 | RequestType type = 4; // 返回类型 27 | 28 | Role role = 5; // 用户角色 29 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgRoleInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgRoleInfoProto"; 7 | enum RequestType{ 8 | CHOOSEROLE = 0; 9 | ROLEINFO = 1; 10 | USEGOODS = 2; 11 | } 12 | 13 | message RequestRoleInfo{ 14 | string requestId = 1; // 请求id 15 | int32 userId = 2; // 请求的uid 16 | string roleName = 3; 17 | int32 occupationId = 4; 18 | RequestType type = 5; // 请求类型 19 | string goodsName = 6; 20 | } 21 | 22 | message ResponseRoleInfo{ 23 | int32 result = 1; // 返回结果 24 | int32 userId = 2; // 返回的uid 25 | string content = 3; 26 | 27 | RequestType type = 4; // 返回类型 28 | 29 | Role role = 5; // 用户角色 30 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgShopInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgShopInfoProto"; 7 | 8 | enum RequestType{ 9 | BUY = 0; 10 | } 11 | 12 | message RequestShopInfo{ 13 | string requestId = 1; // 请求id 14 | int32 userId = 2; // 请求的uid 15 | string goodsName = 3; //物品名称 16 | RequestType type = 4; // 请求类型 17 | } 18 | 19 | message ResponseShopInfo{ 20 | int32 result = 1; // 返回结果 21 | int32 userId = 2; // 返回的uid 22 | string content = 3; // 返回内容 23 | 24 | RequestType type = 4; // 返回类型 25 | 26 | Role role = 5; // 用户角色 27 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgSkillInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgSkillInfoProto"; 7 | 8 | enum RequestType{ 9 | UPGRADESKILL = 0; //升级技能 10 | STUDYSKILL = 1; //学习技能 11 | ROLEPK = 2; //角色PK 12 | USESKILL = 3; //使用技能 13 | } 14 | 15 | message RequestSkillInfo{ 16 | string requestId = 1; // 请求id 17 | int32 userId = 2; // 请求的uid 18 | string skillName = 3; 19 | string target = 4; //攻击目标 20 | RequestType type = 5; // 请求类型 21 | } 22 | 23 | message ResponseSkillInfo{ 24 | int32 result = 1; // 返回结果 25 | int32 userId = 2; // 返回的uid 26 | string content = 3; // 返回内容 27 | 28 | RequestType type = 4; // 返回类型 29 | 30 | Role role = 5; // 用户角色 31 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgTaskInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgTaskInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgTaskInfoProto"; 7 | 8 | enum RequestType{ 9 | QUERYRECEIVABLETASK = 0; 10 | QUERYRECEIVEDTASK = 1; 11 | RECEIVETASK = 2; 12 | DISCARDTASK = 3; 13 | } 14 | 15 | message RequestTaskInfo{ 16 | string requestId = 1; // 请求id 17 | int32 userId = 2; // 请求的uid 18 | string taskId = 3; //任务id 19 | RequestType type = 4; // 请求类型 20 | 21 | } 22 | 23 | message ResponseTaskInfo{ 24 | int32 result = 1; // 返回结果 25 | int32 userId = 2; // 返回的uid 26 | string content = 3; // 返回内容 27 | 28 | RequestType type = 4; // 返回类型 29 | 30 | Role role = 5; // 用户角色 31 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgTradeInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgRoleInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgTradeInfoProto"; 7 | 8 | enum RequestType{ 9 | REQUESTTRADE = 0; 10 | CONFIRMTRADE = 1; 11 | TRADINGGOODS = 2; 12 | TRADINGMONEY = 3; 13 | TRADEGOODS = 4; 14 | } 15 | 16 | message RequestTradeInfo{ 17 | string requestId = 1; // 请求id 18 | int32 userId = 2; // 请求的uid 19 | string roleName = 3; //目的地 20 | RequestType type = 4; // 请求类型 21 | string goodsName = 5; 22 | string uuid = 6; 23 | string number = 7; 24 | } 25 | 26 | message ResponseTradeInfo{ 27 | int32 result = 1; // 返回结果 28 | int32 userId = 2; // 返回的uid 29 | string content = 3; // 返回内容 30 | 31 | RequestType type = 4; // 返回类型 32 | 33 | Role role = 5; // 用户角色 34 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/MsgUserInfo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "Role.proto"; 3 | //protoc --proto_path=src\main\java\com\game\protobuf --java_out=src\main\java src\main\java\com\game\protobuf\MsgUserInfo.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "MsgUserInfoProto"; 7 | enum RequestType{ 8 | LOGIN = 0; 9 | REGISTER = 1; 10 | EXIT = 2; 11 | } 12 | 13 | message RequestUserInfo{ 14 | string requestId = 1; // 请求id 15 | int32 userId = 2; // 请求的uid 16 | string username = 3; 17 | string password = 4; 18 | 19 | RequestType type = 5; // 请求类型 20 | } 21 | 22 | message ResponseUserInfo{ 23 | int32 result = 1; // 返回结果 24 | int32 userId = 2; // 返回的uid 25 | string content = 3; 26 | string token = 4; // token信息 27 | 28 | RequestType type = 5; // 返回类型 29 | 30 | Role role = 6; // 用户角色 31 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/Npc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | //protoc --java_out=src\main\java src\main\java\com\game\protobuf\Map.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "NpcProto"; 7 | 8 | message Npc{ 9 | int32 id = 1; 10 | string name = 2; 11 | string content = 3; 12 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/Role.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | //protoc --java_out=src\main\java src\main\java\com\game\protobuf\Role.proto 4 | 5 | option java_package = "com.game.protobuf.protoc"; 6 | option java_outer_classname = "RoleProto"; 7 | 8 | message Role{ 9 | int32 id = 1; 10 | string name = 2; 11 | int32 level = 3; 12 | int32 curHp = 4; 13 | int32 curMp = 5; 14 | int32 totalHp = 6; 15 | int32 totalMp = 7; 16 | int32 attack = 8; 17 | int32 defend = 9; 18 | int32 backpackCapacity = 10; 19 | int32 money = 11; 20 | } -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/message/ContentType.java: -------------------------------------------------------------------------------- 1 | package com.game.protobuf.message; 2 | 3 | /** 4 | * @ClassName ContentType 5 | * @Description 内容类型 6 | * @Author DELL 7 | * @Date 2019/8/7 19:03 8 | * @Version 1.0 9 | */ 10 | public class ContentType { 11 | public static final String LOGIN_SUCCESS = "登录成功!\n"; 12 | public static final String LOGIN_FAIL = "登录失败!\n"; 13 | public static final String REGISTER_SUCCESS = "注册成功!\n"; 14 | public static final String REGISTER_FAIL = "注册失败!\n"; 15 | public static final String REPEATED_LOGIN = "重复登录!\n"; 16 | public static final String CREATE_ROLE = "成功创建角色!\n"; 17 | public static final String UNCREATE_ROLE = "用户还没创建角色!\n"; 18 | public static final String SEND_SUCCESS = "成功发送消息!\n"; 19 | public static final String EXIT_SUCCESS = "成功退出!\n"; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/game/protobuf/message/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.game.protobuf.message; 2 | 3 | /** 4 | * @ClassName ResultCode 5 | * @Description 结果 6 | * @Author DELL 7 | * @Date 2019/8/7 19:04 8 | * @Version 1.0 9 | */ 10 | public class ResultCode { 11 | /** 12 | * 成功 13 | */ 14 | public static final int SUCCESS = 1; 15 | /** 16 | * 失败 17 | */ 18 | public static final int FAIL = 2; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/game/rank/bean/RankBean.java: -------------------------------------------------------------------------------- 1 | package com.game.rank.bean; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | 5 | /** 6 | * @ClassName RankBean 7 | * @Description 排行榜 8 | * @Author DELL 9 | * @Date 2019/8/5 16:16 10 | * @Version 1.0 11 | */ 12 | public class RankBean { 13 | /** 14 | * 角色 15 | */ 16 | private ConcreteRole role; 17 | /** 18 | * 战力 19 | */ 20 | private Integer comat; 21 | 22 | public ConcreteRole getRole() { 23 | return role; 24 | } 25 | 26 | public void setRole(ConcreteRole role) { 27 | this.role = role; 28 | } 29 | 30 | public Integer getComat() { 31 | return comat; 32 | } 33 | 34 | public void setComat(Integer comat) { 35 | this.comat = comat; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/game/rank/mapper/RankMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.rank.mapper; 2 | 3 | import com.game.rank.bean.RankBean; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @ClassName RankMapper 9 | * @Description 排行榜mapper 10 | * @Author DELL 11 | * @Date 2019/8/5 16:45 12 | * @Version 1.0 13 | */ 14 | public interface RankMapper { 15 | /** 16 | * 查询排行榜 17 | * @return list 18 | */ 19 | public List queryRank(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/game/rank/repository/RankRepository.java: -------------------------------------------------------------------------------- 1 | package com.game.rank.repository; 2 | 3 | import com.game.rank.bean.RankBean; 4 | import com.game.rank.mapper.RankMapper; 5 | import com.game.utils.SqlUtils; 6 | import org.apache.ibatis.session.SqlSession; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @ClassName RankRepository 13 | * @Description 排行榜数据访问 14 | * @Author DELL 15 | * @Date 2019/8/5 16:20 16 | * @Version 1.0 17 | */ 18 | @Repository 19 | public class RankRepository { 20 | /** 21 | * 查询排行榜 22 | * @return list 23 | */ 24 | public List queryRank() { 25 | SqlSession session = SqlUtils.getSession(); 26 | RankMapper mapper = session.getMapper(RankMapper.class); 27 | List rankBeanList = mapper.queryRank(); 28 | return rankBeanList; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/game/role/manager/RoleCacheSchedule.java: -------------------------------------------------------------------------------- 1 | package com.game.role.manager; 2 | 3 | import com.game.annotation.ExcelAnnotation; 4 | import com.game.role.service.RoleService; 5 | import com.game.role.task.UpdateRoleMsgTask; 6 | import com.game.user.threadpool.UserThreadPool; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Component; 9 | 10 | import java.util.concurrent.TimeUnit; 11 | 12 | /** 13 | * @ClassName CacheSchedule 14 | * @Description 刷新缓存定时器 15 | * @Author DELL 16 | * @Date 2019/8/26 22:13 17 | * @Version 1.0 18 | */ 19 | @Component 20 | @ExcelAnnotation 21 | public class RoleCacheSchedule { 22 | /** 23 | * 角色service 24 | */ 25 | @Autowired 26 | private RoleService roleService; 27 | @ExcelAnnotation 28 | public void submit(){ 29 | //创建任务 30 | UpdateRoleMsgTask updateRoleMsgTask = new UpdateRoleMsgTask(roleService); 31 | //执行任务 32 | UserThreadPool.ACCOUNT_SERVICE[0].scheduleAtFixedRate(updateRoleMsgTask,10L,5L, TimeUnit.SECONDS); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/game/role/task/RoleTask.java: -------------------------------------------------------------------------------- 1 | package com.game.role.task; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | import com.game.role.mapper.RoleMapper; 5 | import com.game.utils.SqlUtils; 6 | import org.apache.ibatis.session.SqlSession; 7 | 8 | /** 9 | * @ClassName RoleTask 10 | * @Description 角色任务 11 | * @Author DELL 12 | * @Date 2019/6/13 16:20 13 | * @Version 1.0 14 | */ 15 | public class RoleTask implements Runnable { 16 | /** 17 | * 角色 18 | */ 19 | private ConcreteRole concreteRole; 20 | 21 | public RoleTask(ConcreteRole concreteRole){ 22 | this.concreteRole = concreteRole; 23 | } 24 | @Override 25 | public void run() { 26 | SqlSession session = SqlUtils.getSession(); 27 | try { 28 | RoleMapper mapper = session.getMapper(RoleMapper.class); 29 | mapper.updateRole(concreteRole); 30 | session.commit(); 31 | }finally { 32 | session.close(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/handler/ServerIdleStateHandler.java: -------------------------------------------------------------------------------- 1 | package com.game.server.handler; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.handler.timeout.IdleStateHandler; 5 | 6 | import java.util.concurrent.TimeUnit; 7 | 8 | /** 9 | * @ClassName ServerIdleStateHandler 10 | * @Description TODO 11 | * @Author DELL 12 | * @Date 2019/8/8 11:33 13 | * @Version 1.0 14 | */ 15 | public class ServerIdleStateHandler extends IdleStateHandler { 16 | 17 | private static final int READER_IDLE_TIME = 60 * 5; 18 | 19 | public ServerIdleStateHandler(){ 20 | super(READER_IDLE_TIME, 0, 0, TimeUnit.SECONDS); 21 | } 22 | 23 | 24 | @Override 25 | public void channelActive(ChannelHandlerContext ctx) throws Exception { 26 | ctx.writeAndFlush("from server:成功连接服务端"); 27 | } 28 | 29 | @Override 30 | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { 31 | System.out.println("out line"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/local/LocalMessageMap.java: -------------------------------------------------------------------------------- 1 | package com.game.server.local; 2 | 3 | 4 | import com.game.protobuf.message.MessageType; 5 | import com.google.protobuf.Message; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | public class LocalMessageMap { 11 | /** 12 | * 消息容器map 13 | */ 14 | public static Map, Integer> messageMap = new HashMap<>(); 15 | 16 | public static void readAllMessageType(){ 17 | for (MessageType messageType : MessageType.values()) { 18 | messageMap.put(messageType.getMessageLite(), messageType.getProtoCode()); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/java/com/game/server/local/LocalUserData.java: -------------------------------------------------------------------------------- 1 | package com.game.server.local; 2 | 3 | /** 4 | * @ClassName LocalUserData 5 | * @Description 本地的用户数据 6 | * @Author DELL 7 | * @Date 2019/8/8 16:05 8 | * @Version 1.0 9 | */ 10 | public class LocalUserData { 11 | public static long USERID = 0L; 12 | 13 | 14 | public static void setUserId(long userId){ 15 | USERID = userId; 16 | } 17 | 18 | public static long getUserId(){ 19 | return USERID; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/manager/BuffMap.java: -------------------------------------------------------------------------------- 1 | package com.game.server.manager; 2 | 3 | import com.game.buff.bean.ConcreteBuff; 4 | 5 | import java.util.Map; 6 | import java.util.concurrent.ConcurrentHashMap; 7 | 8 | /** 9 | * @ClassName TaskMap 10 | * @Description buff容器map 11 | * @Author DELL 12 | * @Date 2019/8/14 21:25 13 | * @Version 1.0 14 | */ 15 | public class BuffMap { 16 | private BuffMap(){} 17 | 18 | public static Map getBuffMap(){ 19 | return new ConcurrentHashMap<>(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/manager/TaskMap.java: -------------------------------------------------------------------------------- 1 | package com.game.server.manager; 2 | 3 | import io.netty.util.concurrent.Future; 4 | 5 | import java.util.Map; 6 | import java.util.concurrent.ConcurrentHashMap; 7 | 8 | /** 9 | * @ClassName TaskMap 10 | * @Description 任务容器map 11 | * @Author DELL 12 | * @Date 2019/8/14 21:25 13 | * @Version 1.0 14 | */ 15 | public class TaskMap { 16 | private TaskMap(){} 17 | 18 | public static Map getFutureMap(){ 19 | return new ConcurrentHashMap<>(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestAuctionInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestMapInfoType 5 | * @Description 拍卖行请求信息类型 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestAuctionInfoType { 11 | /** 12 | * 拍卖 13 | */ 14 | public static final int BIDDING = 0; 15 | /** 16 | * 下架 17 | */ 18 | public static final int RECYCLE = 1; 19 | /** 20 | * 上架 21 | */ 22 | public static final int PUBLISH = 2; 23 | /** 24 | * 查询拍卖行的拍卖品 25 | */ 26 | public static final int QUERYAUCTION = 3; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestBossInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestBossInfoType 5 | * @Description Boss请求信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestBossInfoType { 11 | /** 12 | * 进入副本 13 | */ 14 | public static final int ENTERDUPLICATE = 0; 15 | /** 16 | * 创建队伍 17 | */ 18 | public static final int CREATETEAM = 1; 19 | /** 20 | * 加入队伍 21 | */ 22 | public static final int JOINTEAM = 2; 23 | /** 24 | * 退出队伍 25 | */ 26 | public static final int EXITTEAM = 3; 27 | /** 28 | * 解散队伍 29 | */ 30 | public static final int DISMISSTEAM = 4; 31 | /** 32 | * 查询队伍 33 | */ 34 | public static final int QUERYTEAM = 5; 35 | /** 36 | * 团队打副本 37 | */ 38 | public static final int TEAMATTACKBOSS = 6; 39 | /** 40 | * 使用技能攻击怪兽 41 | */ 42 | public static final int USESKILLATTACKBOSS = 7; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestChatInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestChatInfoType 5 | * @Description 聊天信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestChatInfoType { 11 | /** 12 | * 世界聊天 13 | */ 14 | public static final int CHATALL = 0; 15 | /** 16 | * 私聊 17 | */ 18 | public static final int CHATSOMEONE = 1; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestEmailInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestEmailInfoType 5 | * @Description 邮件信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestEmailInfoType { 11 | /** 12 | * 发送物品 13 | */ 14 | public static final int SENDGOODS = 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestEquipInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestEquipInfoType 5 | * @Description 装备请求信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestEquipInfoType { 11 | /** 12 | * 添加装备 13 | */ 14 | public static final int ADDEQUIP = 0; 15 | /** 16 | * 移除装备 17 | */ 18 | public static final int REMOVEEQUIP = 1; 19 | /** 20 | * 展示装备 21 | */ 22 | public static final int SHOWEQUIP = 2; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestGangInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestMapInfoType 5 | * @Description 工会信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestGangInfoType { 11 | /** 12 | * 创建工会 13 | */ 14 | public static final int CREATEGANG = 0; 15 | /** 16 | * 加入工会 17 | */ 18 | public static final int JOINGANG = 1; 19 | /** 20 | * 解散工会 21 | */ 22 | public static final int DISMISSGANG = 2; 23 | /** 24 | * 捐赠 25 | */ 26 | public static final int DONATEMONEY = 3; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestGoodsInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestGoodsInfoType 5 | * @Description 物品信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestGoodsInfoType { 11 | /** 12 | * 获取物品 13 | */ 14 | public static final int GETGOODS = 0; 15 | /** 16 | * 放弃物品 17 | */ 18 | public static final int DISCARDGOODS = 1; 19 | /** 20 | * 展示物品 21 | */ 22 | public static final int SHOWGOODS = 2; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestMapInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestMapInfoType 5 | * @Description 地图信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestMapInfoType { 11 | /** 12 | * 获取地图 13 | */ 14 | public static final int GETMAP = 0; 15 | /** 16 | * 移动,切换地图 17 | */ 18 | public static final int MOVE = 1; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestNpcInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestNpcInfoType 5 | * @Description NPC信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestNpcInfoType { 11 | /** 12 | * 和npc交谈 13 | */ 14 | public static final int TALKTONPC = 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestRankInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestRankInfoType 5 | * @Description 排行榜信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestRankInfoType { 11 | /** 12 | * 查询排行榜 13 | */ 14 | public static final int QUERYRANK = 0; 15 | /** 16 | * 插入排行信息 17 | */ 18 | public static final int INSERTRANK = 1; 19 | public static final int DELETERANK = 2; 20 | public static final int UPDATERANK = 3; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestRoleInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * 角色信息 5 | */ 6 | public class RequestRoleInfoType { 7 | /** 8 | * 选择角色 9 | */ 10 | public static final int CHOOSEROLE = 0; 11 | /** 12 | * 角色信息 13 | */ 14 | public static final int ROLEINFO = 1; 15 | /** 16 | * 使用物品 17 | */ 18 | public static final int USEGOODS = 2; 19 | } -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestShopInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestShopInfoType 5 | * @Description 商店信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestShopInfoType { 11 | /** 12 | * 购买 13 | */ 14 | public static final int BUY = 0; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestSkillInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * 技能信息 5 | */ 6 | public class RequestSkillInfoType { 7 | /** 8 | * 升级技能呢 9 | */ 10 | public static final int UPGRADESKILL = 0; 11 | /** 12 | * 学习技能 13 | */ 14 | public static final int STUDYSKILL = 1; 15 | /** 16 | * 角色pk 17 | */ 18 | public static final int ROLEPK = 2; 19 | /** 20 | * 使用技能 21 | */ 22 | public static final int USESKILL = 3; 23 | } -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestTaskInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestTaskInfoType 5 | * @Description 任务信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestTaskInfoType { 11 | /** 12 | * 查询未接受的任务 13 | */ 14 | public static final int QUERYRECEIVABLETASK = 0; 15 | /** 16 | * 查询已接受的任务 17 | */ 18 | public static final int QUERYRECEIVEDTASK = 1; 19 | /** 20 | * 接受任务 21 | */ 22 | public static final int RECEIVETASK = 2; 23 | /** 24 | * 放弃任务 25 | */ 26 | public static final int DISCARDTASK = 3; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestTradeInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * @ClassName RequestTradeInfoType 5 | * @Description 交易信息 6 | * @Author DELL 7 | * @Date 2019/8/9 15:19 8 | * @Version 1.0 9 | */ 10 | public class RequestTradeInfoType { 11 | /** 12 | * 请求交易 13 | */ 14 | public static final int REQUESTTRADE = 0; 15 | /** 16 | * 确认交易 17 | */ 18 | public static final int CONFIRMTRADE = 1; 19 | /** 20 | * 交易物品 21 | */ 22 | public static final int TRADINGGOODS = 2; 23 | /** 24 | * 交易金币 25 | */ 26 | public static final int TRADINGMONEY = 3; 27 | /** 28 | * 交易 29 | */ 30 | public static final int TRADEGOODS = 4; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/game/server/request/RequestUserInfoType.java: -------------------------------------------------------------------------------- 1 | package com.game.server.request; 2 | 3 | /** 4 | * 用户信息 5 | */ 6 | public class RequestUserInfoType { 7 | /** 8 | * 登录 9 | */ 10 | public static final int LOGIN = 0; 11 | /** 12 | * 注册 13 | */ 14 | public static final int REGISTER = 1; 15 | /** 16 | * 退出 17 | */ 18 | public static final int EXIT = 2; 19 | } -------------------------------------------------------------------------------- /src/main/java/com/game/task/bean/UpdateTaskTask.java: -------------------------------------------------------------------------------- 1 | package com.game.task.bean; 2 | 3 | import com.game.task.mapper.TaskMapper; 4 | import com.game.utils.SqlUtils; 5 | import org.apache.ibatis.session.SqlSession; 6 | 7 | import java.util.concurrent.Callable; 8 | 9 | /** 10 | * @ClassName UpdateTaskTask 11 | * @Description 更新任务 12 | * @Author DELL 13 | * @Date 2019/8/20 11:38 14 | * @Version 1.0 15 | */ 16 | public class UpdateTaskTask implements Callable { 17 | /** 18 | * 角色任务 19 | */ 20 | private RoleTask roleTask; 21 | 22 | public UpdateTaskTask(RoleTask roleTask) { 23 | this.roleTask = roleTask; 24 | } 25 | 26 | @Override 27 | public Object call() throws Exception { 28 | SqlSession session = SqlUtils.getSession(); 29 | try{ 30 | TaskMapper mapper = session.getMapper(TaskMapper.class); 31 | mapper.updateTask(roleTask); 32 | session.commit(); 33 | }finally { 34 | session.close(); 35 | } 36 | return null; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/game/task/manager/TaskMap.java: -------------------------------------------------------------------------------- 1 | package com.game.task.manager; 2 | 3 | import com.game.task.bean.ConcreteTask; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @ClassName TaskMap 10 | * @Description 任务map 11 | * @Author DELL 12 | * @Date 2019/7/22 16:06 13 | * @Version 1.0 14 | */ 15 | public class TaskMap { 16 | /** 17 | * 任务容器map 18 | */ 19 | private static volatile Map taskMap = new HashMap<>(); 20 | 21 | private TaskMap(){} 22 | 23 | public static Map getTaskMap(){ 24 | return taskMap; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/game/task/mapper/TaskMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.task.mapper; 2 | 3 | import com.game.task.bean.RoleTask; 4 | 5 | /** 6 | * @ClassName TaskMapper 7 | * @Description taskMapper 8 | * @Author DELL 9 | * @Date 2019/7/22 20:03 10 | * @Version 1.0 11 | */ 12 | public interface TaskMapper { 13 | /** 14 | * 查询任务 15 | * @param id id 16 | * @return 角色任务 17 | */ 18 | public RoleTask queryTask(int id); 19 | 20 | /** 21 | * 更新任务 22 | * @param roleTask 角色任务 23 | */ 24 | public void updateTask(RoleTask roleTask); 25 | 26 | /** 27 | * 插入任务 28 | * @param roleTask 角色任务 29 | */ 30 | public void insertTask(RoleTask roleTask); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/team/bean/Team.java: -------------------------------------------------------------------------------- 1 | package com.game.team.bean; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @ClassName Team 9 | * @Description 队伍 10 | * @Author DELL 11 | * @Date 2019/8/23 12:15 12 | * @Version 1.0 13 | */ 14 | public class Team { 15 | /** 16 | * 队伍id 17 | */ 18 | private Integer id; 19 | /** 20 | * 队伍名字 21 | */ 22 | private String name; 23 | /** 24 | * 角色列表 25 | */ 26 | private List roleList; 27 | 28 | public Integer getId() { 29 | return id; 30 | } 31 | 32 | public void setId(Integer id) { 33 | this.id = id; 34 | } 35 | 36 | public String getName() { 37 | return name; 38 | } 39 | 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | public List getRoleList() { 45 | return roleList; 46 | } 47 | 48 | public void setRoleList(List roleList) { 49 | this.roleList = roleList; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/game/team/manager/TeamMapManager.java: -------------------------------------------------------------------------------- 1 | package com.game.team.manager; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | 5 | import java.util.HashMap; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | /** 10 | * @ClassName TeamMapManager 11 | * @Description 队伍管理器 12 | * @Author DELL 13 | * @Date 2019/8/23 14:50 14 | * @Version 1.0 15 | */ 16 | public class TeamMapManager { 17 | private TeamMapManager(){} 18 | 19 | private static volatile Map> teamMap = new HashMap<>(); 20 | /** 21 | * key:roleName 22 | * value:teamName 23 | */ 24 | private static volatile Map roleTeamMap = new HashMap<>(); 25 | 26 | public static Map> getTeamMap(){ 27 | return teamMap; 28 | } 29 | 30 | public static Map getRoleTeamMap(){ 31 | return roleTeamMap; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/game/team/mapper/TeamMapper.java: -------------------------------------------------------------------------------- 1 | package com.game.team.mapper; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | /** 6 | * @ClassName TeamMapper 7 | * @Description TeamMapper 8 | * @Author DELL 9 | * @Date 2019/8/23 14:25 10 | * @Version 1.0 11 | */ 12 | public interface TeamMapper { 13 | /** 14 | * addTeam 15 | * @param teamName teamName 16 | * @param roleId roleId 17 | */ 18 | public void addTeam(@Param("teamName") String teamName,@Param("roleId") Integer roleId); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/game/team/repository/TeamRepository.java: -------------------------------------------------------------------------------- 1 | package com.game.team.repository; 2 | 3 | import com.game.team.mapper.TeamMapper; 4 | import com.game.utils.SqlUtils; 5 | import org.apache.ibatis.session.SqlSession; 6 | import org.springframework.stereotype.Repository; 7 | 8 | /** 9 | * @ClassName TeamRepository 10 | * @Description 队伍数据访问 11 | * @Author DELL 12 | * @Date 2019/8/23 12:22 13 | * @Version 1.0 14 | */ 15 | @Repository 16 | public class TeamRepository { 17 | /** 18 | * 创建队伍 19 | * @param teamName teamName 20 | * @param roleId roleId 21 | */ 22 | public void addTeam(String teamName, Integer roleId) { 23 | SqlSession session = SqlUtils.getSession(); 24 | try{ 25 | TeamMapper mapper = session.getMapper(TeamMapper.class); 26 | mapper.addTeam(teamName, roleId); 27 | session.commit(); 28 | }finally { 29 | session.close(); 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/game/trade/manager/TradeMap.java: -------------------------------------------------------------------------------- 1 | package com.game.trade.manager; 2 | 3 | import com.game.trade.bean.Trade; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @ClassName TradeMap 10 | * @Description 交易map 11 | * @Author DELL 12 | * @Date 2019/7/15 16:58 13 | * @Version 1.0 14 | */ 15 | public class TradeMap { 16 | /** 17 | * 交易容器map 18 | */ 19 | private static volatile Map tradeMap = null; 20 | 21 | private TradeMap(){} 22 | 23 | /** 24 | * 获取交易map 25 | * @return map 26 | */ 27 | public static Map getTradeMap(){ 28 | if(tradeMap==null){ 29 | synchronized (TradeMap.class){ 30 | if(tradeMap==null){ 31 | tradeMap = new HashMap<>(); 32 | } 33 | } 34 | } 35 | return tradeMap; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/game/trade/task/Task.java: -------------------------------------------------------------------------------- 1 | package com.game.trade.task; 2 | 3 | /** 4 | * @ClassName DispatcherTask 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/7/15 14:38 8 | * @Version 1.0 9 | */ 10 | public class Task { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/game/user/manager/SessionMap.java: -------------------------------------------------------------------------------- 1 | package com.game.user.manager; 2 | 3 | import com.game.role.bean.ConcreteRole; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | /** 9 | * @ClassName SessionMap 10 | * @Description 存储账号 11 | * @Author DELL 12 | * @Date 2019/8/2 17:52 13 | * @Version 1.0 14 | */ 15 | public class SessionMap { 16 | /** 17 | * session容器map 18 | */ 19 | private static volatile Map sessionMap = new HashMap<>(); 20 | 21 | private SessionMap(){} 22 | 23 | /** 24 | * key:username 25 | * value:role 26 | * @return 27 | */ 28 | public static Map getSessionMap(){ 29 | return sessionMap; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/user/task/UpdateUserTask.java: -------------------------------------------------------------------------------- 1 | package com.game.user.task; 2 | 3 | import com.game.user.bean.User; 4 | import com.game.user.mapper.UserMapper; 5 | import com.game.utils.SqlUtils; 6 | import org.apache.ibatis.session.SqlSession; 7 | 8 | import java.util.concurrent.Callable; 9 | 10 | /** 11 | * @ClassName UpdateUserTask 12 | * @Description 更新User任务 13 | * @Author DELL 14 | * @Date 2019/8/20 11:55 15 | * @Version 1.0 16 | */ 17 | public class UpdateUserTask implements Callable { 18 | /** 19 | * 用户 20 | */ 21 | private User user; 22 | 23 | public UpdateUserTask(User user) { 24 | this.user = user; 25 | } 26 | 27 | @Override 28 | public Object call() throws Exception { 29 | SqlSession session = SqlUtils.getSession(); 30 | try{ 31 | UserMapper mapper = session.getMapper(UserMapper.class); 32 | mapper.updateUser(user); 33 | session.commit(); 34 | }finally { 35 | session.close(); 36 | } 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/game/utils/EnumUtil.java: -------------------------------------------------------------------------------- 1 | package com.game.utils; 2 | 3 | /** 4 | * @ClassName EnumUtil 5 | * @Description 枚举工具类 6 | * @Author DELL 7 | * @Date 2019/7/29 21:29 8 | * @Version 1.0 9 | */ 10 | public class EnumUtil { 11 | 12 | public static QuestType string2Enum(String s) { 13 | for (QuestType e : QuestType.values()) { 14 | if (e.toString().equals(s)) { 15 | return e; 16 | } 17 | } 18 | return null; 19 | } 20 | 21 | 22 | 23 | 24 | public static void main(String[] args) { 25 | 26 | System.out.println(string2Enum("aaa")); 27 | 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/game/utils/ProtobufUtils.java: -------------------------------------------------------------------------------- 1 | package com.game.utils; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | 5 | /** 6 | * @ClassName ProtobufUtils 7 | * @Description protobuf工具类 8 | * @Author DELL 9 | * @Date 2019/8/19 12:28 10 | * @Version 1.0 11 | */ 12 | public class ProtobufUtils { 13 | /** 14 | * 发送协议 15 | */ 16 | public static void sendProtobufMessage(ChannelHandlerContext ctx,Object protobufObject){ 17 | ctx.writeAndFlush(protobufObject); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/game/utils/QuestType.java: -------------------------------------------------------------------------------- 1 | package com.game.utils; 2 | 3 | /** 4 | * @ClassName QuestType 5 | * @Description 任务类型 6 | * @Author DELL 7 | * @Date 2019/7/29 21:30 8 | * @Version 1.0 9 | */ 10 | public enum QuestType { 11 | /** 12 | * 杀怪 13 | */ 14 | KM, 15 | /** 16 | * 谈话 17 | */ 18 | TALK, 19 | /** 20 | * 交易 21 | */ 22 | TRADE, 23 | /** 24 | * 使用物品 25 | */ 26 | USEGOODS; 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/game/utils/RequestTask.java: -------------------------------------------------------------------------------- 1 | package com.game.utils; 2 | 3 | import com.game.dispatcher.DataCodeor; 4 | import com.game.dispatcher.MyAnnotationUtil; 5 | import io.netty.channel.ChannelHandlerContext; 6 | 7 | /** 8 | * @ClassName RequestTask 9 | * @Description 任务处理类 10 | * @Author DELL 11 | * @Date 2019/6/6 15:02 12 | * @Version 1.0 13 | */ 14 | public class RequestTask implements Runnable { 15 | private String content; 16 | private ChannelHandlerContext ctx; 17 | public RequestTask(String content, ChannelHandlerContext ctx){ 18 | this.content = content; 19 | this.ctx = ctx; 20 | } 21 | 22 | @Override 23 | public void run() { 24 | //业务逻辑处理 25 | String result = MyAnnotationUtil.requestService(content,ctx); 26 | //加密 27 | result = DataCodeor.enCodeor(result); 28 | //写出 29 | if (result!=null){ 30 | ctx.channel().writeAndFlush(result); 31 | } 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/game/utils/ThreadPoolUtils.java: -------------------------------------------------------------------------------- 1 | package com.game.utils; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | import java.util.concurrent.Executors; 5 | 6 | /** 7 | * @ClassName ThreadPoolUtils 8 | * @Description 线程池工具类 9 | * @Author DELL 10 | * @Date 2019/6/6 14:46 11 | * @Version 1.0 12 | */ 13 | public class ThreadPoolUtils { 14 | private static volatile ExecutorService threadPoolUtils = Executors.newFixedThreadPool(25); 15 | 16 | /** 17 | * 返回线程池 18 | * @return 19 | */ 20 | public static ExecutorService getThreadPool(){ 21 | return threadPoolUtils; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameclient2/ClientHandler.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameclient2; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.channel.SimpleChannelInboundHandler; 5 | 6 | /** 7 | * @ClassName ClientHandler 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/5/2712:33 11 | * @Version 1.0 12 | */ 13 | public class ClientHandler extends SimpleChannelInboundHandler { 14 | @Override 15 | protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception { 16 | System.out.println(msg); 17 | 18 | } 19 | 20 | @Override 21 | public void channelActive(ChannelHandlerContext ctx) throws Exception { 22 | ctx.channel().writeAndFlush("来自客户端的问候"); 23 | } 24 | 25 | @Override 26 | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { 27 | cause.printStackTrace(); 28 | ctx.close(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameclient2/ClientInitializer.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameclient2; 2 | 3 | import io.netty.channel.ChannelInitializer; 4 | import io.netty.channel.ChannelPipeline; 5 | import io.netty.channel.socket.SocketChannel; 6 | import io.netty.handler.codec.string.StringDecoder; 7 | import io.netty.handler.codec.string.StringEncoder; 8 | import io.netty.util.CharsetUtil; 9 | 10 | /** 11 | * @ClassName ClientInitializer 12 | * @Description TODO 13 | * @Author DELL 14 | * @Date 2019/5/2712:30 15 | * @Version 1.0 16 | */ 17 | public class ClientInitializer extends ChannelInitializer { 18 | @Override 19 | protected void initChannel(SocketChannel ch) throws Exception { 20 | ChannelPipeline pipeline = ch.pipeline(); 21 | pipeline.addLast("stringDecoder",new StringDecoder(CharsetUtil.UTF_8)); 22 | pipeline.addLast("stringEncoder",new StringEncoder(CharsetUtil.UTF_8)); 23 | pipeline.addLast("clientHandler",new ClientHandler()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/State/AliveState.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.State; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | /** 6 | * @ClassName AliveState 7 | * @Description TODO 8 | * @Author DELL 9 | * @Date 2019/5/2412:15 10 | * @Version 1.0 11 | */ 12 | public class AliveState implements State { 13 | private String name; 14 | public AliveState(String name){ 15 | this.name = name; 16 | } 17 | @Override 18 | public void doAction(ParentRole role) { 19 | role.setState(this); 20 | } 21 | 22 | @Override 23 | public String getStateName() { 24 | return name; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/State/DeadState.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.State; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | /** 6 | * @ClassName DeadState 7 | * @Description TODO 8 | * @Author DELL 9 | * @Date 2019/5/2412:16 10 | * @Version 1.0 11 | */ 12 | public class DeadState implements State { 13 | private String name; 14 | public DeadState(String name){ 15 | this.name = name; 16 | } 17 | 18 | @Override 19 | public void doAction(ParentRole role) { 20 | role.setState(this); 21 | } 22 | 23 | @Override 24 | public String getStateName() { 25 | return name; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/State/ForbidState.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.State; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | /** 6 | * @ClassName ForbidState 7 | * @Description 禁用状态 8 | * @Author DELL 9 | * @Date 2019/5/2710:58 10 | * @Version 1.0 11 | */ 12 | public class ForbidState implements State { 13 | private String name; 14 | 15 | public ForbidState(String name) { 16 | this.name = name; 17 | } 18 | 19 | @Override 20 | public void doAction(ParentRole role) { 21 | role.setState(this); 22 | } 23 | 24 | @Override 25 | public String getStateName() { 26 | return name; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/State/State.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.State; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | /** 6 | * @ClassName State 7 | * @Description 状态信息 8 | * @Author DELL 9 | * @Date 2019/5/2412:14 10 | * @Version 1.0 11 | */ 12 | public interface State { 13 | public void doAction(ParentRole role); 14 | public String getStateName(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/map/Castle.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.map; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * @ClassName Castle 10 | * @Description TODO 11 | * @Author DELL 12 | * @Date 2019/5/2412:05 13 | * @Version 1.0 14 | */ 15 | public class Castle implements Map { 16 | private int id; 17 | private String name; 18 | private static List list = new ArrayList<>(); 19 | public Castle(int id, String name) { 20 | this.id = id; 21 | this.name = name; 22 | } 23 | 24 | @Override 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | @Override 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | @Override 35 | public void display() { 36 | System.out.println("您目前在:"+getName()); 37 | } 38 | 39 | @Override 40 | public List getList() { 41 | return list; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/map/Forest.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.map; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * @ClassName Forest 10 | * @Description TODO 11 | * @Author DELL 12 | * @Date 2019/5/2411:51 13 | * @Version 1.0 14 | */ 15 | public class Forest implements Map { 16 | private int id; 17 | private String name; 18 | private static List list = new ArrayList<>(); 19 | public Forest(int id,String name){ 20 | this.id = id; 21 | this.name = name; 22 | } 23 | @Override 24 | public int getId() { 25 | return id; 26 | } 27 | @Override 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | @Override 33 | public void display() { 34 | System.out.println("您目前在:"+getName()); 35 | } 36 | 37 | @Override 38 | public List getList() { 39 | return list; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/map/Map.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.map; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @ClassName Map 9 | * @Description 地图接口 10 | * @Author DELL 11 | * @Date 2019/5/2410:17 12 | * @Version 1.0 13 | */ 14 | public interface Map { 15 | /** 16 | * 地图的唯一id 17 | * @return 18 | */ 19 | public int getId(); 20 | 21 | /** 22 | * 地图的名字 23 | * @return 24 | */ 25 | public String getName(); 26 | 27 | /** 28 | * 地图的显示 29 | */ 30 | public void display(); 31 | 32 | public List getList(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/map/Origin.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.map; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * @ClassName Origin 10 | * @Description TODO 11 | * @Author DELL 12 | * @Date 2019/5/2410:19 13 | * @Version 1.0 14 | */ 15 | public class Origin implements Map { 16 | private int id; 17 | private String name; 18 | private static List list = new ArrayList<>(); 19 | public Origin(int id, String name){ 20 | this.id = id; 21 | this.name = name; 22 | } 23 | @Override 24 | public int getId() { 25 | return id; 26 | } 27 | @Override 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | @Override 33 | public void display() { 34 | System.out.println("您目前在;"+getName()); 35 | } 36 | 37 | @Override 38 | public List getList() { 39 | return list; 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/map/Village.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.map; 2 | 3 | import com.hailintang.gameserver2.role.ParentRole; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * @ClassName Village 10 | * @Description TODO 11 | * @Author DELL 12 | * @Date 2019/5/2410:26 13 | * @Version 1.0 14 | */ 15 | public class Village implements Map { 16 | private int id; 17 | private String name; 18 | private static List list = new ArrayList<>(); 19 | public Village(int id,String name){ 20 | this.id = id; 21 | this.name = name; 22 | } 23 | @Override 24 | public int getId() { 25 | return id; 26 | } 27 | @Override 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | @Override 33 | public void display() { 34 | System.out.println("您目前在:"+getName()); 35 | } 36 | 37 | @Override 38 | public List getList() { 39 | return list; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/role/ParentRole.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.role; 2 | 3 | import com.hailintang.gameserver2.State.State; 4 | import com.hailintang.gameserver2.map.Map; 5 | 6 | /** 7 | * @ClassName ParentRole 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/5/2410:37 11 | * @Version 1.0 12 | */ 13 | public interface ParentRole { 14 | public State getState(); 15 | public void setState(State state); 16 | public void moveTo(Map src, Map dest); 17 | public boolean isExistCurMap(Map map); 18 | public void getLocation(); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/server/ServerHandler.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.server; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.channel.SimpleChannelInboundHandler; 5 | 6 | /** 7 | * @ClassName ServerHandler 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/5/2714:15 11 | * @Version 1.0 12 | */ 13 | public class ServerHandler extends SimpleChannelInboundHandler { 14 | @Override 15 | protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception { 16 | System.out.println(msg); 17 | 18 | } 19 | 20 | @Override 21 | public void channelActive(ChannelHandlerContext ctx) throws Exception { 22 | ctx.channel().writeAndFlush("来自服务端的问候"); 23 | } 24 | 25 | @Override 26 | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { 27 | cause.printStackTrace(); 28 | ctx.close(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/gameserver2/server/ServerInitializer.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.gameserver2.server; 2 | 3 | import io.netty.channel.ChannelInitializer; 4 | import io.netty.channel.ChannelPipeline; 5 | import io.netty.channel.socket.SocketChannel; 6 | import io.netty.handler.codec.string.StringDecoder; 7 | import io.netty.handler.codec.string.StringEncoder; 8 | import io.netty.util.CharsetUtil; 9 | 10 | /** 11 | * @ClassName ServerInitializer 12 | * @Description TODO 13 | * @Author DELL 14 | * @Date 2019/5/2714:13 15 | * @Version 1.0 16 | */ 17 | public class ServerInitializer extends ChannelInitializer { 18 | @Override 19 | protected void initChannel(SocketChannel ch) throws Exception { 20 | ChannelPipeline pipeline = ch.pipeline(); 21 | pipeline.addLast("stringDecoder",new StringDecoder(CharsetUtil.UTF_8)); 22 | pipeline.addLast("stringEncoder",new StringEncoder(CharsetUtil.UTF_8)); 23 | pipeline.addLast("serverHandler",new ServerHandler()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/map/Map.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.map; 2 | 3 | /** 4 | * @ClassName Map 5 | * @Description 地图父类 6 | * @Author DELL 7 | * @Date 2019/5/2217:59 8 | * @Version 1.0 9 | */ 10 | public class Map { 11 | /** 12 | * 地图编号 13 | */ 14 | public int id; 15 | /** 16 | * 地图名称 17 | */ 18 | public int name; 19 | /** 20 | * 地图的x坐标 21 | */ 22 | public int x; 23 | /** 24 | * 地图的Y坐标 25 | */ 26 | public int y; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/map/Origin.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.map; 2 | 3 | /** 4 | * @ClassName Origin 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/5/2218:01 8 | * @Version 1.0 9 | */ 10 | public class Origin extends Map { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/netty_http_test/TestServerInitializer.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.netty_http_test; 2 | 3 | import io.netty.channel.ChannelInitializer; 4 | import io.netty.channel.ChannelPipeline; 5 | import io.netty.channel.socket.SocketChannel; 6 | import io.netty.handler.codec.http.HttpServerCodec; 7 | 8 | /** 9 | * @ClassName TestServerInitializer 10 | * @Description TODO 11 | * @Author DELL 12 | * @Date 2019/5/2215:55 13 | * @Version 1.0 14 | */ 15 | public class TestServerInitializer extends ChannelInitializer { 16 | /** 17 | * 一旦客户端连接到服务端,TestServerInitializer对象就会被创建,initChannel就会被调用 18 | * @param ch 19 | * @throws Exception 20 | */ 21 | @Override 22 | protected void initChannel(SocketChannel ch) throws Exception { 23 | ChannelPipeline channelPipeline = ch.pipeline(); 24 | 25 | channelPipeline.addLast("HttpServerCodec",new HttpServerCodec()); 26 | channelPipeline.addLast("TestHttpServerHandler",new TestHttpServerHandler()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/protobuf_netty/MyClientHandler.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.protobuf_netty; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.channel.SimpleChannelInboundHandler; 5 | 6 | /** 7 | * @ClassName MyClientHandler 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/5/2710:30 11 | * @Version 1.0 12 | */ 13 | public class MyClientHandler extends SimpleChannelInboundHandler { 14 | @Override 15 | protected void channelRead0(ChannelHandlerContext ctx, PersonInfo.Student msg) throws Exception { 16 | 17 | } 18 | 19 | @Override 20 | public void channelActive(ChannelHandlerContext ctx) throws Exception { 21 | PersonInfo.Student student = PersonInfo.Student.newBuilder() 22 | .setAddress("广州") 23 | .setAge(22) 24 | .setName("汤海麟").build(); 25 | ctx.channel().writeAndFlush(student); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/protobuf_netty/MyServerHandler.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.protobuf_netty; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.channel.SimpleChannelInboundHandler; 5 | 6 | /** 7 | * @ClassName MyServerHandler 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/5/2710:18 11 | * @Version 1.0 12 | */ 13 | public class MyServerHandler extends SimpleChannelInboundHandler { 14 | @Override 15 | protected void channelRead0(ChannelHandlerContext ctx, PersonInfo.Student msg) throws Exception { 16 | System.out.println(msg.getAddress()); 17 | System.out.println(msg.getAge()); 18 | System.out.println(msg.getName()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/read_write_monitor/MyInitializer.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.read_write_monitor; 2 | 3 | import io.netty.channel.ChannelInitializer; 4 | import io.netty.channel.ChannelPipeline; 5 | import io.netty.channel.socket.SocketChannel; 6 | import io.netty.handler.timeout.IdleStateHandler; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | /** 11 | * @ClassName MyInitializer 12 | * @Description TODO 13 | * @Author DELL 14 | * @Date 2019/5/2314:47 15 | * @Version 1.0 16 | */ 17 | public class MyInitializer extends ChannelInitializer { 18 | @Override 19 | protected void initChannel(SocketChannel ch) throws Exception { 20 | ChannelPipeline pipeline = ch.pipeline(); 21 | pipeline.addLast("idleStateHandler",new IdleStateHandler(5,7,10, TimeUnit.SECONDS)); 22 | pipeline.addLast("myHandler",new MyHandler()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/service/Login.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.service; 2 | 3 | /** 4 | * @ClassName Login 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/5/2715:34 8 | * @Version 1.0 9 | */ 10 | public class Login { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/service/Register.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.service; 2 | 3 | /** 4 | * @ClassName RegisterService 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/5/2715:34 8 | * @Version 1.0 9 | */ 10 | public class Register { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/hailintang/socket_chat_server_multiclient/client/MyChatClientHandler.java: -------------------------------------------------------------------------------- 1 | package com.hailintang.socket_chat_server_multiclient.client; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.channel.SimpleChannelInboundHandler; 5 | 6 | /** 7 | * @ClassName MyChatClientHandler 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/5/2311:28 11 | * @Version 1.0 12 | */ 13 | public class MyChatClientHandler extends SimpleChannelInboundHandler { 14 | @Override 15 | protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception { 16 | System.out.println(msg); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/test/annotation/Todo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This code demonstrates how to define an annotation. 3 | * 4 | * @author Yashwant Golecha (ygolecha@gmail.com) 5 | * @version 1.0 6 | * 7 | */ 8 | 9 | package com.test.annotation; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.lang.annotation.Target; 15 | 16 | @Target(ElementType.METHOD) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | @interface Todo { 19 | public enum Priority {LOW, MEDIUM, HIGH} 20 | public enum Status {STARTED, NOT_STARTED} 21 | String author() default "Yash"; 22 | Priority priority() default Priority.LOW; 23 | Status status() default Status.NOT_STARTED; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/test/annotation/acm/Find1Num.java: -------------------------------------------------------------------------------- 1 | package com.test.annotation.acm; 2 | 3 | /** 4 | * @author Aaron 5 | * @date 2019-09-12 17:48 6 | * @function 7 | */ 8 | public class Find1Num { 9 | public int NumberOf1Between1AndN_Solution(int n){ 10 | //记录次数 11 | int count = 0; 12 | //遍历 13 | for(int i=1;i<=n;i++){ 14 | //数字转字符串 15 | String target = String.valueOf(i); 16 | //字符串转字符 17 | char[] chars = target.toCharArray(); 18 | 19 | for (int j=0;j { 14 | return x.toUpperCase(); 15 | }, "abCwerty"); 16 | 17 | System.out.println(str); 18 | 19 | String s = operation((x) -> { 20 | return x.substring(2, 4); 21 | }, "qweqqwe"); 22 | 23 | System.out.println(s); 24 | 25 | } 26 | 27 | public String operation(MyFunc myFunc,String lowerStr){ 28 | return myFunc.getValue(lowerStr); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/test/lambda/demo04/MyFunc.java: -------------------------------------------------------------------------------- 1 | package com.test.lambda.demo04; 2 | 3 | /** 4 | * @author Aaron 5 | * @date 2019-09-12 11:47 6 | * @function 7 | */ 8 | @FunctionalInterface 9 | public interface MyFunc { 10 | public R getValue(T t1,T t2); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/test/lambda/demo04/TestLambda.java: -------------------------------------------------------------------------------- 1 | package com.test.lambda.demo04; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * @author Aaron 7 | * @date 2019-09-12 12:06 8 | * @function 9 | */ 10 | public class TestLambda { 11 | @Test 12 | public void test01(){ 13 | long l = get((x, y) -> x + y, 100, 99); 14 | System.out.println(l); 15 | 16 | long l1 = get((x, y) -> x * y, 100, 99); 17 | System.out.println(l1); 18 | } 19 | 20 | public long get(MyFunc myFunc,long t1,long t2){ 21 | return myFunc.getValue(t1,t2); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/test/lambda/demo06/TestMethodRef.java: -------------------------------------------------------------------------------- 1 | package com.test.lambda.demo06; 2 | 3 | import org.junit.Test; 4 | 5 | import java.io.PrintStream; 6 | import java.util.function.BiPredicate; 7 | import java.util.function.Consumer; 8 | 9 | /** 10 | * @author Aaron 11 | * @date 2019-09-16 10:34 12 | * @function 13 | */ 14 | public class TestMethodRef { 15 | @Test 16 | public void test01(){ 17 | PrintStream printStream = System.out; 18 | //先实现函数 19 | Consumer consumer = printStream::println; 20 | //后调用 21 | consumer.accept("567890"); 22 | } 23 | 24 | @Test 25 | public void test02(){ 26 | BiPredicate predicate = (x,y)->x.equals(y); 27 | 28 | BiPredicate biPredicate = String::equals; 29 | 30 | boolean test = biPredicate.test("123", "123"); 31 | System.out.println(test); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/test/load/AbstractConfigLoader.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | 4 | public abstract class AbstractConfigLoader implements IConfigLoader{ 5 | 6 | protected IConfigProvider provider; 7 | 8 | protected AbstractConfigLoader(IConfigProvider provider) { 9 | this.provider = provider; 10 | } 11 | 12 | @Override 13 | public T load() throws Exception { 14 | return load(getProvider().provide()); 15 | } 16 | public abstract T load(U loaderSource) throws Exception; 17 | 18 | protected IConfigProvider getProvider() { 19 | return this.provider; 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/java/com/test/load/AppleConfig.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | /** 4 | * 5 | * 6 | * @author Bean 7 | * @date 2016年1月21日 下午11:03:45 8 | * @version 1.0 9 | * 10 | */ 11 | public class AppleConfig { 12 | 13 | private int price; 14 | private String color; 15 | 16 | public void setPrice(int price) { 17 | this.price = price; 18 | } 19 | 20 | public int getPrice() { 21 | return this.price; 22 | } 23 | 24 | public void setColor(String color) { 25 | this.color = color; 26 | } 27 | 28 | public String getColor() { 29 | return this.color; 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/test/load/ConfigProviderFactory.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | import org.w3c.dom.Document; 4 | 5 | import java.util.Properties; 6 | 7 | /** 8 | * 9 | * 10 | * @author Bean 11 | * @date 2016年1月21日 上午11:56:28 12 | * @version 1.0 13 | * 14 | */ 15 | public class ConfigProviderFactory { 16 | 17 | private ConfigProviderFactory() { 18 | throw new UnsupportedOperationException("Unable to initialize a factory class : " 19 | + getClass().getSimpleName()); 20 | } 21 | 22 | // public static IConfigProvider createDocumentProvider(String filePath) { 23 | // return new DocumentProvider(filePath); 24 | // } 25 | // 26 | // public static IConfigProvider createPropertiesProvider(String filePath) { 27 | // return new PropertiesProvider(filePath); 28 | // } 29 | // 30 | // public static IConfigProvider createDigesterProvider(String filePath) { 31 | // return new DigesterProvider(filePath); 32 | // } 33 | } -------------------------------------------------------------------------------- /src/main/java/com/test/load/EggConfig.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | /** 4 | * 5 | * 6 | * @author Bean 7 | * @date 2016年1月21日 下午11:03:58 8 | * @version 1.0 9 | * 10 | */ 11 | public class EggConfig { 12 | 13 | private int weight; 14 | 15 | public void setWeight(int weight) { 16 | this.weight = weight; 17 | } 18 | 19 | public int getWeight() { 20 | return this.weight; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/test/load/IConfigLoader.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | /** 4 | * 配置加载器 5 | * @param 6 | */ 7 | public interface IConfigLoader { 8 | 9 | /** 10 | * load the config typed by T 11 | * 12 | * @return 13 | * @throws Exception 14 | */ 15 | public T load() throws Exception; 16 | } -------------------------------------------------------------------------------- /src/main/java/com/test/load/IConfigProvider.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | /** 4 | * 配置加载器 5 | * @param 6 | */ 7 | public interface IConfigProvider { 8 | /** 9 | * provide a config source used for loading config 10 | * @return 11 | * @throws Exception 12 | */ 13 | public T provide() throws Exception; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/test/load/MarketConfig.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | /** 4 | * 5 | * 6 | * @author Bean 7 | * @date 2016年1月21日 下午11:03:37 8 | * @version 1.0 9 | * 10 | */ 11 | public class MarketConfig { 12 | 13 | private AppleConfig appleConfig; 14 | private EggConfig eggConfig; 15 | private OwnerConfig ownerConfig; 16 | 17 | public AppleConfig getAppleConfig() { 18 | return appleConfig; 19 | } 20 | public void setAppleConfig(AppleConfig appleConfig) { 21 | this.appleConfig = appleConfig; 22 | } 23 | public EggConfig getEggConfig() { 24 | return eggConfig; 25 | } 26 | public void setEggConfig(EggConfig eggConfig) { 27 | this.eggConfig = eggConfig; 28 | } 29 | public OwnerConfig getOwnerConfig() { 30 | return ownerConfig; 31 | } 32 | public void setOwnerConfig(OwnerConfig ownerConfig) { 33 | this.ownerConfig = ownerConfig; 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/com/test/load/OwnerConfig.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | import java.util.Collections; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | /** 8 | * 9 | * 10 | * @author Bean 11 | * @date 2016年1月21日 下午11:04:06 12 | * @version 1.0 13 | * 14 | */ 15 | public class OwnerConfig { 16 | 17 | private Map owner = new HashMap(); 18 | 19 | public void addOwner(String portName, String owner) { 20 | this.owner.put(portName, owner); 21 | } 22 | 23 | public String getOwnerByPortName(String portName) { 24 | return this.owner.get(portName); 25 | } 26 | 27 | public Map getOwners() { 28 | return Collections.unmodifiableMap(this.owner); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/test/load/OwnerConfigLoader.java: -------------------------------------------------------------------------------- 1 | package com.test.load; 2 | 3 | import java.util.Properties; 4 | 5 | /** 6 | * 7 | * 8 | * @author Bean 9 | * @date 2016年1月21日 下午11:24:50 10 | * @version 1.0 11 | * 12 | */ 13 | public class OwnerConfigLoader extends AbstractConfigLoader{ 14 | 15 | /** 16 | * @param provider 17 | */ 18 | protected OwnerConfigLoader(IConfigProvider provider) { 19 | super(provider); 20 | } 21 | 22 | /* 23 | * @see AbstractConfigLoader#load(java.lang.Object) 24 | */ 25 | @Override 26 | public OwnerConfig load(Properties props) throws Exception { 27 | OwnerConfig ownerConfig = new OwnerConfig(); 28 | 29 | /** 30 | * 利用props,设置ownerConfig的属性值 31 | * 32 | * 此处代码省略 33 | */ 34 | return ownerConfig; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/test/load/demo01/BMWCar.java: -------------------------------------------------------------------------------- 1 | package com.test.load.demo01; 2 | 3 | /** 4 | * @ClassName BMWCar 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/6/415:36 8 | * @Version 1.0 9 | */ 10 | public class BMWCar implements ICarFactory { 11 | @Override 12 | public void makeCar() { 13 | System.out.println("i am a BMW"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/test/load/demo01/BYDCar.java: -------------------------------------------------------------------------------- 1 | package com.test.load.demo01; 2 | 3 | /** 4 | * @ClassName BYDCar 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/6/415:36 8 | * @Version 1.0 9 | */ 10 | public class BYDCar implements ICarFactory { 11 | @Override 12 | public void makeCar() { 13 | System.out.println("i am a BYD"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/test/load/demo01/ICarFactory.java: -------------------------------------------------------------------------------- 1 | package com.test.load.demo01; 2 | 3 | public interface ICarFactory { 4 | public void makeCar();//等待实现的造车方法 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/test/observer/FirstObserver.java: -------------------------------------------------------------------------------- 1 | package com.test.observer; 2 | 3 | /** 4 | * @ClassName FirstObserver 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/7/25 10:24 8 | * @Version 1.0 9 | */ 10 | public class FirstObserver extends Observer { 11 | public FirstObserver(Subject subject){ 12 | this.subject = subject; 13 | this.subject.register(this); 14 | } 15 | @Override 16 | public void update() { 17 | System.out.println("FirstObserver"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/test/observer/Observer.java: -------------------------------------------------------------------------------- 1 | package com.test.observer; 2 | 3 | /** 4 | * @ClassName Observer 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/7/25 10:14 8 | * @Version 1.0 9 | */ 10 | public abstract class Observer { 11 | protected Subject subject; 12 | public abstract void update(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/test/observer/SecondObserver.java: -------------------------------------------------------------------------------- 1 | package com.test.observer; 2 | 3 | /** 4 | * @ClassName SecondObserver 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/7/25 10:24 8 | * @Version 1.0 9 | */ 10 | public class SecondObserver extends Observer { 11 | public SecondObserver(Subject subject){ 12 | this.subject = subject; 13 | this.subject.register(this); 14 | } 15 | @Override 16 | public void update() { 17 | System.out.println("secondObserver"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/test/observer/Subject.java: -------------------------------------------------------------------------------- 1 | package com.test.observer; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @ClassName Subject 8 | * @Description TODO 9 | * @Author DELL 10 | * @Date 2019/7/25 10:13 11 | * @Version 1.0 12 | */ 13 | public class Subject { 14 | private List observerList = new ArrayList<>(); 15 | private int state; 16 | 17 | public void setState(int state) { 18 | this.state = state; 19 | notifyA(); 20 | } 21 | 22 | public void register(Observer observer){ 23 | observerList.add(observer); 24 | } 25 | 26 | public void notifyA(){ 27 | for (int i = 0; i < observerList.size(); i++) { 28 | observerList.get(i).update(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/test/observer/Test.java: -------------------------------------------------------------------------------- 1 | package com.test.observer; 2 | 3 | /** 4 | * @ClassName Test 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/7/25 10:28 8 | * @Version 1.0 9 | */ 10 | public class Test { 11 | public static void main(String[] args) { 12 | Subject subject = new Subject(); 13 | 14 | FirstObserver firstObserver = new FirstObserver(subject); 15 | SecondObserver secondObserver = new SecondObserver(subject); 16 | ThirdObserver thirdObserver = new ThirdObserver(subject); 17 | 18 | firstObserver.subject.setState(1); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/test/observer/ThirdObserver.java: -------------------------------------------------------------------------------- 1 | package com.test.observer; 2 | 3 | /** 4 | * @ClassName ThirdObserver 5 | * @Description TODO 6 | * @Author DELL 7 | * @Date 2019/7/25 10:27 8 | * @Version 1.0 9 | */ 10 | public class ThirdObserver extends Observer { 11 | public ThirdObserver(Subject subject){ 12 | this.subject = subject; 13 | this.subject.register(this); 14 | } 15 | @Override 16 | public void update() { 17 | System.out.println("thirdObserver"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/test/stackoverflow/Question01.java: -------------------------------------------------------------------------------- 1 | package com.test.stackoverflow; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | /** 8 | * @ClassName Question01 9 | * @Description 时区问题(环境:jdk1.6) 10 | * @Author DELL 11 | * @Date 2019/6/10 12:14 12 | * @Version 1.0 13 | */ 14 | public class Question01 { 15 | public static void main(String[] args) throws ParseException { 16 | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 17 | String str3 = "1927-12-31 23:54:07"; 18 | String str4 = "1927-12-31 23:54:08"; 19 | Date sDt3 = sf.parse(str3); 20 | Date sDt4 = sf.parse(str4); 21 | long ld3 = sDt3.getTime() /1000; 22 | long ld4 = sDt4.getTime() /1000; 23 | System.out.println(ld4-ld3); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/test/stackoverflow/Question03.java: -------------------------------------------------------------------------------- 1 | package com.test.stackoverflow; 2 | 3 | /** 4 | * @ClassName Question03 5 | * @Description i+=j问题 6 | * @Author DELL 7 | * @Date 2019/6/10 14:29 8 | * @Version 1.0 9 | */ 10 | public class Question03 { 11 | public static void main(String[] args) { 12 | int i = 3; 13 | int k = 3; 14 | double j = 4.3; 15 | // i = i + j;//无法编译 16 | i +=j;//可以编译,实际上i+=j,是等价于i = (int)(i+j) 17 | j +=k;//j = (double)(j+k) 18 | System.out.println("i:"+i); 19 | System.out.println("j:"+j); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/test/stackoverflow/Question04.java: -------------------------------------------------------------------------------- 1 | package com.test.stackoverflow; 2 | 3 | import java.util.HashMap; 4 | import java.util.Iterator; 5 | import java.util.Map; 6 | import java.util.Set; 7 | 8 | /** 9 | * @ClassName Question04 10 | * @Description 遍历HashMap的最佳方法---------->entrySet() 11 | * @Author DELL 12 | * @Date 2019/6/10 14:38 13 | * @Version 1.0 14 | */ 15 | public class Question04 { 16 | public static void main(String[] args) { 17 | Map map = new HashMap<>(); 18 | map.put("1","小明"); 19 | map.put("2","小龙"); 20 | map.put("3","小马哥"); 21 | 22 | Set> entrySet = map.entrySet(); 23 | Iterator> iterator = entrySet.iterator(); 24 | while(iterator.hasNext()){ 25 | Map.Entry next = iterator.next(); 26 | System.out.println(next.getKey()+"======"+next.getValue()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/test/stackoverflow/Question05.java: -------------------------------------------------------------------------------- 1 | package com.test.stackoverflow; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | 7 | /** 8 | * @ClassName Question05 9 | * @Description 如何从数组创建ArrayList 10 | * @Author DELL 11 | * @Date 2019/6/10 14:42 12 | * @Version 1.0 13 | */ 14 | public class Question05 { 15 | public static void main(String[] args) { 16 | String[] strings = {new String("hello"),new String("world"),new String("Aaron")}; 17 | 18 | for (int i = 0; i < strings.length; i++) { 19 | System.out.println(strings[i]); 20 | } 21 | 22 | List list = new ArrayList<>(Arrays.asList(strings)); 23 | for (int i = list.size() - 1; i >= 0; i--) { 24 | System.out.println(list.get(i)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/Action.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | /** 6 | * 为分发创建对象 7 | */ 8 | public class Action { 9 | 10 | private Method method; 11 | 12 | private Object object; 13 | 14 | public Method getMethod() { 15 | return method; 16 | } 17 | 18 | public void setMethod(Method method) { 19 | this.method = method; 20 | } 21 | 22 | public Object getObject() { 23 | return object; 24 | } 25 | 26 | public void setObject(Object object) { 27 | this.object = object; 28 | } 29 | 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/ActionBeanPostProcessor.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import org.springframework.beans.BeansException; 4 | import org.springframework.beans.factory.config.BeanPostProcessor; 5 | 6 | import java.lang.reflect.Method; 7 | 8 | public class ActionBeanPostProcessor implements BeanPostProcessor { 9 | 10 | @Override 11 | public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { 12 | return bean; 13 | } 14 | 15 | @Override 16 | public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { 17 | Method[] methods=bean.getClass().getMethods(); 18 | for (Method method : methods) { 19 | ActionMap actionMap=method.getAnnotation(ActionMap.class); 20 | if(actionMap!=null){ 21 | Action action=new Action(); 22 | action.setMethod(method); 23 | action.setObject(bean); 24 | ActionMapUtil.put(actionMap.key(), action); 25 | } 26 | } 27 | return bean; 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/ActionMap.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Retention(RetentionPolicy.RUNTIME) 6 | @Target(ElementType.METHOD) 7 | @Documented 8 | public @interface ActionMap { 9 | 10 | int key(); 11 | 12 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/ActionMapUtil.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import java.lang.reflect.Method; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | public class ActionMapUtil { 8 | 9 | private static Map map = new HashMap(); 10 | 11 | public static Object invote(Integer key, Object... args) throws Exception { 12 | //根据command获得相应的请求操作 13 | Action action = map.get(key); 14 | if (action != null) { 15 | Method method = action.getMethod(); 16 | try { 17 | return method.invoke(action.getObject(), args); 18 | } catch (Exception e) { 19 | throw e; 20 | } 21 | } 22 | return null; 23 | } 24 | 25 | public static void put(Integer key, Action action) { 26 | map.put(key, action); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/MessageEncoder.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import io.netty.channel.ChannelHandlerContext; 5 | import io.netty.handler.codec.MessageToByteEncoder; 6 | 7 | public class MessageEncoder extends MessageToByteEncoder { 8 | 9 | @Override 10 | protected void encode(ChannelHandlerContext ctx, Message msg, ByteBuf out) throws Exception { 11 | Header header = msg.getHeader(); 12 | out.writeByte(MessageDecoder.PACKAGE_TAG); 13 | out.writeByte(header.getEncode()); 14 | out.writeByte(header.getEncrypt()); 15 | out.writeByte(header.getExtend1()); 16 | out.writeByte(header.getExtend2()); 17 | out.writeBytes(header.getSessionid().getBytes()); 18 | out.writeInt(header.getLength()); 19 | out.writeInt(header.getCammand()); 20 | out.writeBytes(msg.getData().getBytes("UTF-8")); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/NettyController.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.annotation.*; 6 | 7 | @Retention(RetentionPolicy.RUNTIME) 8 | @Target(ElementType.TYPE) 9 | @Documented 10 | @Component 11 | public @interface NettyController { 12 | 13 | 14 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/ServerHandler.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import io.netty.channel.ChannelHandlerAdapter; 4 | import io.netty.channel.ChannelHandlerContext; 5 | 6 | public class ServerHandler extends ChannelHandlerAdapter { 7 | 8 | 9 | public void channelActive(ChannelHandlerContext ctx) throws Exception { 10 | String content="我收到连接"; 11 | Header header=new Header((byte)0, (byte)1, (byte)1, (byte)1, (byte)0, "713f17ca614361fb257dc6741332caf2",content.getBytes("UTF-8").length, 1); 12 | Message message=new Message(header,content); 13 | ctx.writeAndFlush(message); 14 | 15 | } 16 | 17 | @Override 18 | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { 19 | cause.printStackTrace(); 20 | ctx.close(); 21 | } 22 | 23 | 24 | public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { 25 | Message m = (Message) msg; // (1) 26 | 27 | /* 请求分发*/ 28 | // ActionMapUtil.invote(header.getCammand(),ctx, m); 29 | } 30 | 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/Test.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class Test { 7 | 8 | 9 | public static void main(String[] args) { 10 | ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml"); 11 | TimeServer timeServer= ac.getBean(TimeServer.class); 12 | try { 13 | timeServer.start(8888); 14 | } catch (InterruptedException e) { 15 | // TODO Auto-generated catch block 16 | e.printStackTrace(); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testgameserverclient/UserAction.java: -------------------------------------------------------------------------------- 1 | package com.test.testgameserverclient; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | 6 | @NettyController() 7 | public class UserAction { 8 | 9 | 10 | // @Autowired 11 | // private UserService userService; 12 | // 13 | // 14 | // @ActionMap(key=1) 15 | // public String login(ChannelHandlerContext ct, Message message){ 16 | // UserModel userModel=this.userService.findByMasterUserId(1000001); 17 | // System.out.println(String.format("用户昵称:%s;密码%d;传人内容%s", userModel.getNickname(),userModel.getId(),message.getData())); 18 | // return userModel.getNickname(); 19 | // } 20 | } -------------------------------------------------------------------------------- /src/main/java/com/test/testmysql/Parsing.java: -------------------------------------------------------------------------------- 1 | package com.test.testmysql; 2 | 3 | public class Parsing { 4 | /** 5 | * Returns Integer corresponding to s, or null if s is null. 6 | * @throws NumberFormatException if s is nonnull and 7 | * doesn't represent a valid integer 8 | */ 9 | public static Integer parseInt(String s) { 10 | return (s == null) ? null : Integer.parseInt(s); 11 | } 12 | public static void main(String[] args) { 13 | System.out.println(parseInt("-1")); 14 | System.out.println(parseInt(null)); 15 | System.out.println(parseInt("1")); 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/excel/Buff.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Buff.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Goods.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Goods.xls -------------------------------------------------------------------------------- /src/main/resources/excel/GoodsType.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/GoodsType.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Map.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Map.xlsx -------------------------------------------------------------------------------- /src/main/resources/excel/MapMapping.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/MapMapping.xls -------------------------------------------------------------------------------- /src/main/resources/excel/MapNpcMapping.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/MapNpcMapping.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Monster.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Monster.xls -------------------------------------------------------------------------------- /src/main/resources/excel/MonsterMapMapping.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/MonsterMapMapping.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Npc.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Npc.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Occupation.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Occupation.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Permission.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Permission.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Property.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Property.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Skill.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Skill.xls -------------------------------------------------------------------------------- /src/main/resources/excel/Task.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/src/main/resources/excel/Task.xls -------------------------------------------------------------------------------- /src/main/resources/load/factory.xml: -------------------------------------------------------------------------------- 1 | 2 |        3 |       com.test.load.demo01.BMWCar 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/load/market.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | red 4 | 100 5 | 6 | 7 | 200 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/load/owner.properties: -------------------------------------------------------------------------------- 1 | port1=Steve Jobs 2 | port2=Bill Gates 3 | port3=Kobe Bryant -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=WARN, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 4 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n 5 | -------------------------------------------------------------------------------- /src/main/resources/mapper/Backpack2Mapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 13 | 14 | 16 | insert into backpack2 values 17 | (#{roleId},#{goodsBag}) 18 | ON DUPLICATE KEY UPDATE 19 | goodsBag = #{goodsBag} 20 | 21 | -------------------------------------------------------------------------------- /src/main/resources/mapper/EquipmentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | insert into equipment(role_id,equipment_box) values(#{roleId},#{equipmentPart}) 9 | 10 | 11 | 12 | update equipment set equipment_box =#{equipmentPart} where role_id=#{roleId} 13 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /src/main/resources/mapper/MapMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 13 | 16 | 19 | 20 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/mapper/RankMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /src/main/resources/mapper/StateMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TaskMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | update roletask set receivedTask=#{receivedTask},finishedTask=#{finishedTask},count=#{count} where roleId=#{roleId} 12 | 13 | 14 | 15 | insert into roletask(roleId,receivedTask) values (#{roleId},#{receivedTask}) 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TeamMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | insert into team(name,roleId1) values (#(teamName),#(roleId)) 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/my.properties: -------------------------------------------------------------------------------- 1 | #ָ�����������ڵİ� Ȼ�󽻸�ע�⹤����ɨ�� 2 | my.controller.package=com.game 3 | #�������ǵ������Ƕ��� Ĭ��true���� 4 | my.single=true 5 | #扫描excel 6 | excel.file=com.game -------------------------------------------------------------------------------- /target/classes/com/game/client/Client.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/client/Client.class -------------------------------------------------------------------------------- /target/classes/com/game/client/ClientHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/client/ClientHandler.class -------------------------------------------------------------------------------- /target/classes/com/game/client/ClientInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/client/ClientInitializer.class -------------------------------------------------------------------------------- /target/classes/com/game/dispatcher/ClassAndMethodDTO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/dispatcher/ClassAndMethodDTO.class -------------------------------------------------------------------------------- /target/classes/com/game/dispatcher/ClassUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/dispatcher/ClassUtil.class -------------------------------------------------------------------------------- /target/classes/com/game/dispatcher/DataCodeor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/dispatcher/DataCodeor.class -------------------------------------------------------------------------------- /target/classes/com/game/dispatcher/MyAnnotationUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/dispatcher/MyAnnotationUtil.class -------------------------------------------------------------------------------- /target/classes/com/game/dispatcher/RequestAnnotation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/dispatcher/RequestAnnotation.class -------------------------------------------------------------------------------- /target/classes/com/game/dispatcher/ResultDTO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/dispatcher/ResultDTO.class -------------------------------------------------------------------------------- /target/classes/com/game/dispatcher/StringUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/dispatcher/StringUtil.class -------------------------------------------------------------------------------- /target/classes/com/game/server/Server.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/server/Server.class -------------------------------------------------------------------------------- /target/classes/com/game/server/ServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/server/ServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/game/server/ServerInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/server/ServerInitializer.class -------------------------------------------------------------------------------- /target/classes/com/game/utils/SqlUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/game/utils/SqlUtils.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameclient2/Client.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameclient2/Client.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameclient2/ClientHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameclient2/ClientHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameclient2/ClientInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameclient2/ClientInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/Main/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/Main/Main.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/State/AliveState.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/State/AliveState.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/State/DeadState.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/State/DeadState.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/State/ForbidState.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/State/ForbidState.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/State/State.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/State/State.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/map/Castle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/map/Castle.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/map/CentralMap.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/map/CentralMap.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/map/Forest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/map/Forest.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/map/Map.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/map/Map.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/map/MapInfo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/map/MapInfo.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/map/Origin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/map/Origin.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/map/Village.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/map/Village.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/role/ParentRole.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/role/ParentRole.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/role/Role_01.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/role/Role_01.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/role/Role_02.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/role/Role_02.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/server/Server.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/server/Server.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/server/ServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/server/ServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/gameserver2/server/ServerInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/gameserver2/server/ServerInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/map/Map.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/map/Map.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/map/Origin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/map/Origin.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/netty_http_test/TestHttpServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/netty_http_test/TestHttpServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/netty_http_test/TestServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/netty_http_test/TestServer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/netty_http_test/TestServerInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/netty_http_test/TestServerInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/MyClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/MyClient.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/MyClientHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/MyClientHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/MyClientInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/MyClientInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/MyServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/MyServer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/MyServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/MyServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/MyServerInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/MyServerInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/PersonInfo$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/PersonInfo$1.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/PersonInfo$Student$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/PersonInfo$Student$1.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/PersonInfo$Student$Builder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/PersonInfo$Student$Builder.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/PersonInfo$Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/PersonInfo$Student.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/PersonInfo$StudentOrBuilder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/PersonInfo$StudentOrBuilder.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/protobuf_netty/PersonInfo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/protobuf_netty/PersonInfo.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/read_write_monitor/MyHandler$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/read_write_monitor/MyHandler$1.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/read_write_monitor/MyHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/read_write_monitor/MyHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/read_write_monitor/MyInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/read_write_monitor/MyInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/read_write_monitor/MyServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/read_write_monitor/MyServer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/service/Login.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/service/Login.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/service/Register.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/service/Register.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_chat_server_multiclient/client/MyChatClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_chat_server_multiclient/client/MyChatClient.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_chat_server_multiclient/client/MyChatClientHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_chat_server_multiclient/client/MyChatClientHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_chat_server_multiclient/client/MyChatClientInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_chat_server_multiclient/client/MyChatClientInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_chat_server_multiclient/server/MyChatInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_chat_server_multiclient/server/MyChatInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_chat_server_multiclient/server/MyChatServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_chat_server_multiclient/server/MyChatServer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_chat_server_multiclient/server/MyChatServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_chat_server_multiclient/server/MyChatServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_client/MyClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_client/MyClient.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_client/MyClientHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_client/MyClientHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_client/MyClientInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_client/MyClientInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_client/MyServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_client/MyServer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_client/MyServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_client/MyServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_client/MyServerInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_client/MyServerInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_multiclient/MyClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_multiclient/MyClient.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_multiclient/MyClientHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_multiclient/MyClientHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_multiclient/MyClientInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_multiclient/MyClientInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_multiclient/MyServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_multiclient/MyServer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_multiclient/MyServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_multiclient/MyServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/socket_server_multiclient/MyServerInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/socket_server_multiclient/MyServerInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/web_socket_demo01/MyTextWebSocketFrame.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/web_socket_demo01/MyTextWebSocketFrame.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/web_socket_demo01/MyWebSocketInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/web_socket_demo01/MyWebSocketInitializer.class -------------------------------------------------------------------------------- /target/classes/com/hailintang/web_socket_demo01/MyWebSocketServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/hailintang/web_socket_demo01/MyWebSocketServer.class -------------------------------------------------------------------------------- /target/classes/com/test/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/Main.class -------------------------------------------------------------------------------- /target/classes/com/test/annotation/BusinessLogic.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/annotation/BusinessLogic.class -------------------------------------------------------------------------------- /target/classes/com/test/annotation/Todo$Priority.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/annotation/Todo$Priority.class -------------------------------------------------------------------------------- /target/classes/com/test/annotation/Todo$Status.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/annotation/Todo$Status.class -------------------------------------------------------------------------------- /target/classes/com/test/annotation/Todo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/annotation/Todo.class -------------------------------------------------------------------------------- /target/classes/com/test/annotation/TodoReport.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/annotation/TodoReport.class -------------------------------------------------------------------------------- /target/classes/com/test/io/AIO/AioServer$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/io/AIO/AioServer$1.class -------------------------------------------------------------------------------- /target/classes/com/test/io/AIO/AioServer$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/io/AIO/AioServer$2.class -------------------------------------------------------------------------------- /target/classes/com/test/io/AIO/AioServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/io/AIO/AioServer.class -------------------------------------------------------------------------------- /target/classes/com/test/io/BIO/BioServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/io/BIO/BioServer.class -------------------------------------------------------------------------------- /target/classes/com/test/io/BIO/Client.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/io/BIO/Client.class -------------------------------------------------------------------------------- /target/classes/com/test/io/NIO/NioServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/io/NIO/NioServer.class -------------------------------------------------------------------------------- /target/classes/com/test/jdk8/lambda/Demo01.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/jdk8/lambda/Demo01.class -------------------------------------------------------------------------------- /target/classes/com/test/load/AbstractConfigLoader.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/AbstractConfigLoader.class -------------------------------------------------------------------------------- /target/classes/com/test/load/AppleConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/AppleConfig.class -------------------------------------------------------------------------------- /target/classes/com/test/load/ConfigProviderFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/ConfigProviderFactory.class -------------------------------------------------------------------------------- /target/classes/com/test/load/EggConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/EggConfig.class -------------------------------------------------------------------------------- /target/classes/com/test/load/IConfigLoader.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/IConfigLoader.class -------------------------------------------------------------------------------- /target/classes/com/test/load/IConfigProvider.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/IConfigProvider.class -------------------------------------------------------------------------------- /target/classes/com/test/load/MarketConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/MarketConfig.class -------------------------------------------------------------------------------- /target/classes/com/test/load/MarketConfigLoader.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/MarketConfigLoader.class -------------------------------------------------------------------------------- /target/classes/com/test/load/OwnerConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/OwnerConfig.class -------------------------------------------------------------------------------- /target/classes/com/test/load/OwnerConfigLoader.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/OwnerConfigLoader.class -------------------------------------------------------------------------------- /target/classes/com/test/load/demo01/BMWCar.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/demo01/BMWCar.class -------------------------------------------------------------------------------- /target/classes/com/test/load/demo01/BYDCar.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/demo01/BYDCar.class -------------------------------------------------------------------------------- /target/classes/com/test/load/demo01/ICarFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/demo01/ICarFactory.class -------------------------------------------------------------------------------- /target/classes/com/test/load/demo01/TestMain.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/demo01/TestMain.class -------------------------------------------------------------------------------- /target/classes/com/test/load/demo02/Dom4jDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/load/demo02/Dom4jDemo.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/Action.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/Action.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/ActionBeanPostProcessor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/ActionBeanPostProcessor.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/ActionMap.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/ActionMap.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/ActionMapUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/ActionMapUtil.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/ClientTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/ClientTest.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/Header.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/Header.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/Message.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/Message.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/MessageDecoder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/MessageDecoder.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/MessageEncoder.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/MessageEncoder.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/NettyController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/NettyController.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/ServerHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/ServerHandler.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/Test.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/TimeServer$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/TimeServer$1.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/TimeServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/TimeServer.class -------------------------------------------------------------------------------- /target/classes/com/test/testgameserverclient/UserAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aaron-TangCode/MMORPG/2e67f34d387c56e7a91dc7e822ec3ad5620147ad/target/classes/com/test/testgameserverclient/UserAction.class --------------------------------------------------------------------------------