Documentation
¶
Index ¶
- Constants
- Variables
- func BuildHeader(seq *uint8, id uint8) []byte
- func BuildUserInfo(flags uint32, info UserInfo, id uint32, needID bool) []byte
- func GetNextSeq(seq *uint8) uint8
- func IsIllegal(num uint32) bool
- func NewNullString() []byte
- func ReadSubMenu(b []byte, offset *int) []uint32
- func SendPacket(data []byte, client net.Conn)
- func WriteItem(num uint32, curitem *uint8) []byte
- func WriteLen(data *[]byte)
- type ChannelInfo
- type ChannelServer
- type InAchievementCampaignPacket
- type InAchievementPacket
- type InAssistPacket
- type InChangeTeamPacket
- type InChatPacket
- type InDeathPacket
- type InFavoritePacket
- type InFavoriteSetCosmetics
- type InFavoriteSetLoadout
- type InFeedbackPacket
- type InGameScorePacket
- type InHostBuyItemPacket
- type InHostDataCachePacket
- type InHostDataPacket
- type InHostDataUsersPacket
- type InHostItemUsingPacket
- type InHostPacket
- type InHostSetBuyMenu
- type InHostSetInventoryPacket
- type InHostSetLoadoutPacket
- type InHostTeamChangingPacket
- type InJoinRoomPacket
- type InKillPacket
- type InLoginPacket
- type InMailListPacket
- type InMailPacket
- type InNewRoomPacket
- type InOpenBoxPacket
- type InOptionBuyMenu
- type InOptionPacket
- type InPlayerInfoPacket
- type InPointLottoPacket
- type InPointLottoUsePacket
- type InQuickList
- type InQuickPacket
- type InReportMsgPacket
- type InReportPacket
- type InReportSearchUserPacket
- type InRevivedPacket
- type InRoomCountdownPacket
- type InRoomListRequestPacket
- type InRoomPaket
- type InSetAvatarPacket
- type InSetCampaignPacket
- type InSetSignaturePacket
- type InSetTitlePacket
- type InShopBuyItemPacket
- type InShopPacket
- type InSupplyPacket
- type InUDPmsg
- type InUpSettingReq
- type InWeaponPointArray
- type InWeaponPointPacket
- type OutAchievementCampaign
- type OutAchievementCampaignItems
- type OutLobbyJoinRoom
- type PacketData
- func (p *PacketData) PraseChangeTeamPacket(dest *InChangeTeamPacket) bool
- func (p *PacketData) PraseChannelRequest(dest *InRoomListRequestPacket) bool
- func (p *PacketData) PraseFavoritePacket(dest *InFavoritePacket) bool
- func (p *PacketData) PraseFavoriteSetCosmeticsPacket(dest *InFavoriteSetCosmetics) bool
- func (p *PacketData) PraseFavoriteSetLoadoutPacket(dest *InFavoriteSetLoadout) bool
- func (p *PacketData) PraseHostPacket(dest *InHostPacket) bool
- func (p *PacketData) PraseInAchievementCampaignPacket(dest *InAchievementCampaignPacket) bool
- func (p *PacketData) PraseInAchievementPacket(dest *InAchievementPacket) bool
- func (p *PacketData) PraseInAssistPacket(dest *InAssistPacket) bool
- func (p *PacketData) PraseInChatPacket(dest *InChatPacket) bool
- func (p *PacketData) PraseInDeathPacket(dest *InDeathPacket) bool
- func (p *PacketData) PraseInGameScorePacket(dest *InGameScorePacket) bool
- func (p *PacketData) PraseInHostBuyItemPacket(dest *InHostBuyItemPacket) bool
- func (p *PacketData) PraseInHostDataCachePacket(dest *InHostDataCachePacket) bool
- func (p *PacketData) PraseInHostDataPacket(dest *InHostDataPacket) bool
- func (p *PacketData) PraseInHostDataUsersPacket(dest *InHostDataUsersPacket) bool
- func (p *PacketData) PraseInHostItemUsingPacket(dest *InHostItemUsingPacket) bool
- func (p *PacketData) PraseInKillPacket(dest *InKillPacket) bool
- func (p *PacketData) PraseInQuickListPacket(dest *InQuickList) bool
- func (p *PacketData) PraseInRevivedPacket(dest *InRevivedPacket) bool
- func (p *PacketData) PraseInTeamChangingPacket(dest *InHostTeamChangingPacket) bool
- func (p *PacketData) PraseInWeaponPointPacket(dest *InWeaponPointPacket) bool
- func (p *PacketData) PraseJoinRoomPacket(dest *InJoinRoomPacket) bool
- func (dataPacket *PacketData) PraseLoginPacket(p *InLoginPacket) bool
- func (p *PacketData) PraseMailListPacket(dest *InMailListPacket) bool
- func (p *PacketData) PraseMailPacket(dest *InMailPacket) bool
- func (p *PacketData) PraseNewRoomQuest(dest *InNewRoomPacket) bool
- func (p *PacketData) PraseOpenBoxPacket(dest *InOpenBoxPacket) bool
- func (p *PacketData) PraseOptionPacket(dest *InOptionPacket) bool
- func (p *PacketData) PrasePlayerInfoPacket(dest *InPlayerInfoPacket) bool
- func (p *PacketData) PrasePointLottoPacket(dest *InPointLottoPacket) bool
- func (p *PacketData) PrasePointLottoUsePacket(dest *InPointLottoUsePacket) bool
- func (p *PacketData) PraseQuickPacket(dest *InQuickPacket) bool
- func (p *PacketData) PraseReportMsgPacket(dest *InReportMsgPacket) bool
- func (p *PacketData) PraseReportPacket(dest *InReportPacket) bool
- func (p *PacketData) PraseReportSearchUserPacket(dest *InReportSearchUserPacket) bool
- func (p *PacketData) PraseRoomCountdownPacket(dest *InRoomCountdownPacket) bool
- func (p *PacketData) PraseRoomFeedbackPacket(dest *InFeedbackPacket) bool
- func (p *PacketData) PraseRoomPacket(dest *InRoomPaket) bool
- func (p *PacketData) PraseSaveBuyMenu(dest *InOptionBuyMenu) bool
- func (p *PacketData) PraseSetAvatarPacket(dest *InSetAvatarPacket) bool
- func (p *PacketData) PraseSetBuyMenuPacket(dest *InHostSetBuyMenu) bool
- func (p *PacketData) PraseSetCampaignPacket(dest *InSetCampaignPacket) bool
- func (p *PacketData) PraseSetSignaturePacket(dest *InSetSignaturePacket) bool
- func (p *PacketData) PraseSetTitlePacket(dest *InSetTitlePacket) bool
- func (p *PacketData) PraseSetUserInventoryPacket(dest *InHostSetInventoryPacket) bool
- func (p *PacketData) PraseSetUserLoadoutPacket(dest *InHostSetLoadoutPacket) bool
- func (p *PacketData) PraseShopBuyItemPacket(dest *InShopBuyItemPacket) bool
- func (p *PacketData) PraseShopPacket(dest *InShopPacket) bool
- func (p *PacketData) PraseSupplyPacket(dest *InSupplyPacket) bool
- func (p *PacketData) PraseUpdateRoomPacket(dest *InUpSettingReq) bool
- type PacketHeader
- type Room
- func (rm Room) CanStartGame() bool
- func (rm *Room) CheckIngameStatus()
- func (rm *Room) CountRoomCtKill()
- func (rm *Room) CountRoomTrKill()
- func (rm Room) FindDesirableTeam() int
- func (rm Room) GetAllCtNum() int
- func (rm Room) GetAllTrNum() int
- func (rm *Room) GetCountdown() uint8
- func (rm Room) GetFreeSlots() int
- func (rm Room) GetNumOfReadyPlayers() int
- func (rm Room) GetNumOfRealIngamePlayers() int
- func (rm Room) GetNumOfRealReadyPlayers() int
- func (rm Room) IsGlobalCountdownInProgress() bool
- func (rm *Room) JoinUser(u *User) bool
- func (rm *Room) ProgressCountdown(num uint8)
- func (rm *Room) ResetRoomKillNum()
- func (rm *Room) ResetRoomScore()
- func (rm *Room) ResetRoomWinner()
- func (rm Room) RoomGetUser(id uint32) *User
- func (rm *Room) RoomRemoveUser(id uint32)
- func (rm *Room) RoomSaveCache(pagenum uint8, data []byte)
- func (rm *Room) SetRoomHost(u *User)
- func (rm *Room) SetRoomScore(ctScore uint8, trScore uint8)
- func (rm *Room) SetRoomWinner(Winner uint8)
- func (rm *Room) SetStatus(status uint8)
- func (rm *Room) StopCountdown()
- func (rm *Room) SyncUserNum(num uint8)
- func (dest *Room) ToUpdateSetting(src *InUpSettingReq)
- type RoomSettings
- type ServerManager
- type UManager
- type UnlockItem
- type UnlockKillNum
- type UnlockSeq
- type User
- func (u *User) AddItem(itemid uint32)
- func (u *User) AddItemSingle(itemid uint32)
- func (u *User) AddMatches()
- func (u *User) AddWins()
- func (u *User) BuildUserNetInfo() []byte
- func (u *User) CountAssistNum()
- func (u *User) CountDeadNum(num uint16)
- func (u *User) CountKillNum(num uint16)
- func (u *User) CountWeaponKill(itemid uint32)
- func (u *User) DecreaseItem(itemid uint32) bool
- func (u *User) GetAssists(num uint32)
- func (u *User) GetDeathes(num uint32)
- func (u *User) GetExp(num uint64)
- func (u *User) GetItemIDBySeq(seq uint16) uint32
- func (u *User) GetKills(num uint32)
- func (u *User) GetPoints(num uint64)
- func (u User) GetUserChannelID() uint8
- func (u User) GetUserChannelServerID() uint8
- func (u User) GetUserRoomID() uint16
- func (u User) GetUserTeam() uint8
- func (u User) IsGM() bool
- func (u User) IsUserReady() bool
- func (u User) IsVIP() bool
- func (u *User) JoinRoom(id uint16, team uint8)
- func (u *User) PunishPoints()
- func (u *User) QuitChannel()
- func (u *User) QuitRoom()
- func (u *User) RemoveItem(itemid uint32)
- func (u *User) ResetAssistNum()
- func (u *User) ResetDeadNum()
- func (u *User) ResetKillNum()
- func (u *User) SetAvatar(id uint16)
- func (u *User) SetBuyMenu(menu UserBuyMenu)
- func (u *User) SetGM()
- func (u *User) SetID(id uint32)
- func (u *User) SetInventoryItems(items *[]UserInventoryItem)
- func (u *User) SetNewMutex()
- func (u *User) SetSignature(sig []byte)
- func (u *User) SetTitle(id uint16)
- func (u *User) SetUserChannel(id uint8)
- func (u *User) SetUserChannelServer(id uint8)
- func (u *User) SetUserIngame(ingame bool)
- func (u *User) SetUserName(loginName, username string)
- func (u *User) SetUserRoom(id uint16)
- func (u *User) SetUserStatus(status uint8)
- func (u *User) SetUserTeam(team uint8)
- func (u *User) SetVIP()
- func (u *User) UpdateCampaign(id uint16)
- func (u *User) UpdateHolepunch(portId uint16, localPort uint16, externalPort uint16) uint16
- func (u *User) Updated()
- func (u *User) UseCredits(num uint32) bool
- func (u *User) UseMPoints(num uint32) bool
- func (u *User) UsePoints(num uint64) bool
- type UserBuyMenu
- type UserInfo
- type UserInventory
- type UserInventoryItem
- type UserLoadout
- type UserNetInfo
Constants ¶
View Source
const ( Campaign_0 = 1 Campaign_1 = 8 << 0 Campaign_2 = 8 << 1 Campaign_3 = 8 << 2 Campaign_4 = 8 << 3 Campaign_5 = 8 << 4 Campaign_6 = 8 << 5 )
View Source
const ( ChatDirectMessage = 0 ChatChannel = 1 ChatRoom = 2 ChatIngameGlobal = 3 ChatIngameTeam = 4 ChatClan = 5 ChatParty = 7 //组队 ChatIngameParty = 9 )
View Source
const ( MessageCongratulate = 11 MessageNoticeImportant = 20 MessageDialogBox = 21 MessageNotice = 22 MessageNotice2 = 23 MessageDialogBoxExit = 60 )
View Source
const ( //packet's first main type PacketTypeVersion = 0 PacketTypeReply = 1 PacketTypeLogin = 3 PacketTypeServerList = 5 PacketTypeCharacter = 6 PacketTypeRequestRoomList = 7 PacketTypeRequestChannels = 10 PacketTypeRoom = 65 PacketTypeChat = 67 PacketTypeHost = 68 PacketTypePlayerInfo = 69 PacketTypeUdp = 70 PacketTypeShop = 72 PacketTypeBan = 74 PacketTypeOption = 76 PacketTypeFavorite = 77 PacketTypeUseItem = 78 PacketTypeQuickJoin = 80 PacketTypeReport = 83 PacketTypeSignature = 85 PacketTypeQuickStart = 86 PacketTypeAutomatch = 88 PacketTypeFriend = 89 PacketTypeUnlock = 90 PacketTypeMail = 91 PacketTypeGZ = 95 PacketTypeAchievement = 96 PacketTypeSupply = 102 PacketTypeDisassemble = 104 PacketTypeConfigInfo = 106 PacketTypeLobby = 107 PacketTypeUserStart = 150 PacketTypeRoomList = 151 PacketTypeInventory_Add = 152 PacketTypeInventory_Create = 154 PacketTypeUserInfo = 157 //beacuse there is only 1 byte of sequence in packet , so max number is 0xff MINSEQUENCE = 0 MAXSEQUENCE = math.MaxUint8 //server will read 4 bytes of header HeaderLen = 4 SUBMENU_ITEM_NUM = 9 )
View Source
const ( GameStart = 0 HostJoin = 1 HostRestart = 2 HostStop = 3 LeaveResultWindow = 4 GameContinue = 5 //频道以及房间 SendFullRoomList = 0 JoinRoom = 1 UpdateUserInfo = 2 //房间操作 NewRoomRequest = 0 JoinRoomRequest = 1 LeaveRoomRequest = 3 ToggleReadyRequest = 4 GameStartRequest = 5 UpdateSettings = 6 OnCloseResultWindow = 7 JoinRoomFiled = 8 SetUserTeamRequest = 9 GameStartCountdownRequest = 19 Feedback = 30 //游戏模式 ModeOriginal = 1 ModeTeamdeath = 2 ModeZombie = 3 ModeStealth = 4 ModeGunteamdeath = 5 ModeTutorial = 6 ModeHide = 7 ModePig = 8 ModeAnimationtest_vcd = 9 ModeGz_survivor = 10 ModeDevtest = 11 ModeOriginalmr = 12 ModeOriginalmrdraw = 13 ModeCasualbomb = 14 ModeDeathmatch = 15 ModeScenario_test = 16 ModeGz = 17 ModeGz_intro = 18 ModeGz_tour = 19 ModeGz_pve = 20 ModeEventmod01 = 21 ModeDuel = 22 ModeGz_ZB = 23 ModeHeroes = 24 ModeEventmod02 = 25 ModeZombiecraft = 26 ModeCampaign1 = 27 ModeCampaign2 = 28 ModeCampaign3 = 29 ModeCampaign4 = 30 ModeCampaign5 = 31 ModeCampaign6 = 32 ModeCampaign7 = 33 ModeCampaign8 = 34 ModeCampaign9 = 35 ModeZ_scenario = 36 ModeZombie_prop = 37 ModeGhost = 38 ModeTag = 39 ModeHide_match = 40 ModeHide_ice = 41 ModeDiy = 42 ModeHide_Item = 43 ModeZd_boss1 = 44 ModeZd_boss2 = 45 ModeZd_boss3 = 46 ModePractice = 47 ModeZombie_commander = 48 ModeCasualoriginal = 49 ModeHide2 = 50 ModeGunball = 51 ModeZombie_zeta = 53 ModeTdm_small = 54 ModeDe_small = 55 ModeGunteamdeath_re = 56 ModeEndless_wave = 57 ModeRankmatch_original = 58 ModeRankmatch_teamdeath = 59 ModePlay_ground = 60 ModeMadcity = 61 ModeHide_origin = 62 ModeTeamdeath_mutation = 63 ModeGiant = 64 ModeZ_scenario_side = 65 ModeHide_multi = 66 ModeMadcity_team = 67 ModeRankmatch_stealth = 68 //房间status StatusWaiting = 1 StatusIngame = 2 //队伍平衡 Disabled = 0 Enabled = 1 WithBots = 2 ByKadRatio = 4 //房间包表示 OUTCreateAndJoin = 0 OUTPlayerJoin = 1 OUTPlayerLeave = 2 OUTSetPlayerReady = 3 OUTUpdateSettings = 4 OUTSetHost = 5 OUTSetGameResult = 6 OUTsetUserTeam = 7 OUTCountdown = 14 DefaultCountdownNum = 7 //Start CountDown InProgress = 0 Stop = 1 )
View Source
const ( MAXCHANNELNUM = 16 MAXSERVERNUM = 15 MAXCHANNELROOMNUM = 0xFF MAXROOMNUM = 0xFFFF DefalutServerName = "CSO2-Server[1/1]" DefalutChannelName1 = "CSO2-Channel[1/2]" DefalutChannelName2 = "CSO2-Channel[2/2]" //貌似非3以外的都被客户端认为是战队频道 ChannelServerTypeNormal = 1 ChannelServerTypeTeam = 3 //ChannelType ChannelTypeFree = 0 ChannelTypeNovice = 1 ChannelTypeNoviceLowKAD = 2 ChannelTypeClan = 3 ChannelTypeBigCity = 4 ChannelTypeActive = 5 //only open for active ChannelStatusBusy = 0 ChannelStatusNormal = 1 )
View Source
const ( UdpPacketSignature = 87 UDPTypeClient = 0 UDPTypeServer = 256 UDPTypeSourceTV = 512 )
View Source
const ( //user status UserNotReady = 0 UserIngame = 1 UserReady = 2 //阵营 UserForceUnknown = 0 UserForceTerrorist = 1 UserForceCounterTerrorist = 2 )
View Source
const (
//MAXUSERNUM , 8096 is enough
MAXUSERNUM = 8096
)
Variables ¶
View Source
var ( GAME_ROOM_LEAVE_EARLY = []byte("你因提前退出而被扣除1000Points!") GAME_SERVER_ERROR = []byte("你与服务端的连接遭遇到不可恢复性错误,请联系服务器管理员并提供报错信息以便管理员查找和修复错误!") GAME_LOGIN_ALREADY = []byte("您的账号当前已经有人登录!如果你的账号已泄露请联系管理员!") GAME_LOGIN_EXIT_FORCE = []byte("您的账号当前有人登录!您已被强制退出!") GAME_LOGIN_ERROR = []byte("登录过程发生错误,请联系服务器管理员并提供报错信息以便管理员查找和修复错误!") GAME_ROOM_COUNT_MODE_ERROR = []byte("无法开始游戏!请检查你的房间设置,比如是否有2人及以上或者开启bot") GAME_ROOM_JOIN_ERROR = []byte("加入房间发生错误!") GAME_GM_ADD_ALLWEAPONS = []byte("所有武器已存入你的仓库!") GAME_CHANNEL_MESSAGE_NOT_IN = []byte("你未进入任何频道!") GAME_GM_NO_AUTHORIZE = []byte("你没有权限进行此操作!") GAME_USER_NEW_ITEM = []byte("你获得了管理员给予的物品!") GAME_USER_NEW_ITEM_RESTART = []byte("重启游戏以获得奖励的物品!") GAME_CHANNEL_MESSAGE = "频道" GAME_ROOM_JOIN_FAILED_CLOSED = []byte("#CSO2_POPUP_ROOM_JOIN_FAILED_CLOSED") GAME_ROOM_JOIN_FAILED_FULL = []byte("#CSO2_POPUP_ROOM_JOIN_FAILED_FULL") GAME_ROOM_JOIN_FAILED_BAD_PASSWORD = []byte("#CSO2_POPUP_ROOM_JOIN_FAILED_INVALID_PASSWD") GAME_ROOM_CHANGETEAM_FAILED = []byte("#CSO2_POPUP_ROOM_CHANGETEAM_FAILED") GAME_ROOM_COUNTDOWN_FAILED_NOENEMIES = []byte("#CSO2_UI_ROOM_COUNTDOWN_FAILED_NOENEMY") GAME_LOGIN_BAD_USERINFO = []byte("#CSO2_LoginAuth_Certify_NoPassport") GAME_LOGIN_BAD_PASSWORD = []byte("#CSO2_LoginAuth_WrongPassword") GAME_LOGIN_BAD_USERNAME = []byte("#CSO2_LoginAuth_UserNotExists") GAME_LOGIN_TENTH_FAILED = []byte("#CSO2_LoginAuth_TempBlockedByLoginFail") GAME_LOGIN_INVALID_USERINFO = []byte("#CSO2_ServerMessage_INVALID_USERINFO") GAME_REPORT_USER_SUCCEED = []byte("#CSO2_POPUP_USER_REPORT_SUCCEED") CSO2_BUY_FAIL_CN_0X11_NO_CASH = []byte("#CSO2_BUY_FAIL_CN_0X11_NO_CASH") CSO2_BUY_FAIL_NO_POINT = []byte("#CSO2_BUY_FAIL_NO_POINT") CSO2_BUY_FAIL_NO_MILEAGE = []byte("#CSO2_BUY_FAIL_NO_MILEAGE") CSO2_BUY_SUCCEED = []byte("#CSO2_BUY_SUCCEED") CSO2_BUY_FAIL_CN_0X12_DB_ERROR = []byte("#CSO2_BUY_FAIL_CN_0X12_DB_ERROR") CSO2_UI_RAMDOMBOX_ALERT_000 = []byte("#CSO2_UI_RAMDOMBOX_ALERT_000") )
View Source
var ( UnlockItemList = [...]uint32{ 1, 9, 10, 24, 11, 60, 31, 17, 28, 59, 53, 26, 25, 63, 20, 7, 62, 5, 44, 16, 12, 22, 52, 70, 71, 77, 85, 48, 29, 32, 37, 106, 112, 111, 110, 105, 114, 107, 109, 74, 75, 78, 82, 91, 95, 96, 100, 104, 109, 108, 110, 66, 67, 120, 121, 124, 122, 123, 125, 126, 129, 130, 131, 133, 132, 135, 138, 143, 144, 145, 155, 156, 151, 152, 153, } UnlockFullList = []UnlockItem{ UnlockItem{ UnlockItemList[0], 0x0B, 0x01, 0x3E8, }, UnlockItem{ UnlockItemList[1], 0x0C, 0x01, 0x5DC, }, UnlockItem{ UnlockItemList[2], 0x0D, 0x01, 0x3E8, }, UnlockItem{ UnlockItemList[3], 0x0E, 0x01, 0x5DC, }, UnlockItem{ UnlockItemList[4], 0x0F, 0x01, 0x708, }, UnlockItem{ UnlockItemList[5], 0x10, 0x01, 0xBB80, }, UnlockItem{ UnlockItemList[6], 0x11, 0x01, 0x5DC0, }, UnlockItem{ UnlockItemList[7], 0x12, 0x01, 0x708, }, UnlockItem{ UnlockItemList[8], 0x13, 0x01, 0x1D4C, }, UnlockItem{ UnlockItemList[9], 0x14, 0x01, 0x6160, }, UnlockItem{ UnlockItemList[10], 0x15, 0x01, 0x7530, }, UnlockItem{ UnlockItemList[11], 0x16, 0x01, 0xFA0, }, UnlockItem{ UnlockItemList[12], 0x17, 0x01, 0x3A98, }, UnlockItem{ UnlockItemList[13], 0x18, 0x01, 0x493E0, }, UnlockItem{ UnlockItemList[14], 0x19, 0x01, 0xFA0, }, UnlockItem{ UnlockItemList[15], 0x1A, 0x01, 0x3A98, }, UnlockItem{ UnlockItemList[16], 0x1B, 0x01, 0x493E0, }, UnlockItem{ UnlockItemList[17], 0x1C, 0x01, 0x708, }, UnlockItem{ UnlockItemList[18], 0x1D, 0x01, 0x7530, }, UnlockItem{ UnlockItemList[19], 0x1E, 0x01, 0x1388, }, UnlockItem{ UnlockItemList[20], 0x1F, 0x01, 0x4E20, }, UnlockItem{ UnlockItemList[21], 0x20, 0x01, 0x4E20, }, UnlockItem{ UnlockItemList[22], 0x43, 0x01, 0x7530, }, UnlockItem{ UnlockItemList[23], 0x57, 0x01, 0x7A120, }, UnlockItem{ UnlockItemList[24], 0x58, 0x01, 0x7A120, }, UnlockItem{ UnlockItemList[25], 0x59, 0x01, 0x190, }, UnlockItem{ UnlockItemList[26], 0x81, 0x01, 0x370, }, UnlockItem{ UnlockItemList[27], 0x90, 0x01, 0x7530, }, UnlockItem{ UnlockItemList[28], 0x91, 0x01, 0xEA60, }, UnlockItem{ UnlockItemList[29], 0x92, 0x01, 0x1E848, }, UnlockItem{ UnlockItemList[30], 0x93, 0x01, 0x30D40, }, UnlockItem{ UnlockItemList[31], 0xA8, 0x00, 0x28, }, UnlockItem{ UnlockItemList[32], 0xA9, 0x00, 0x50, }, UnlockItem{ UnlockItemList[33], 0xAA, 0x00, 0x28, }, UnlockItem{ UnlockItemList[34], 0xAB, 0x00, 0x50, }, UnlockItem{ UnlockItemList[35], 0xAC, 0x00, 0x28, }, UnlockItem{ UnlockItemList[36], 0xAD, 0x00, 0x50, }, UnlockItem{ UnlockItemList[37], 0xAE, 0x00, 0x28, }, UnlockItem{ UnlockItemList[38], 0xAF, 0x00, 0x50, }, UnlockItem{ UnlockItemList[39], 0xD7, 0x01, 0xC350, }, UnlockItem{ UnlockItemList[40], 0xD8, 0x01, 0x17700, }, UnlockItem{ UnlockItemList[41], 0xE8, 0x01, 0x11170, }, UnlockItem{ UnlockItemList[42], 0xE9, 0x01, 0x1D4C0, }, UnlockItem{ UnlockItemList[43], 0x106, 0x01, 0x249F0, }, UnlockItem{ UnlockItemList[44], 0x119, 0x01, 0xEA60, }, UnlockItem{ UnlockItemList[45], 0x11A, 0x01, 0x1D4C0, }, UnlockItem{ UnlockItemList[46], 0x138, 0x01, 0x249F0, }, UnlockItem{ UnlockItemList[47], 0x15C, 0x01, 0x7A120, }, UnlockItem{ UnlockItemList[48], 0x182, 0x01, 0x186A0, }, UnlockItem{ UnlockItemList[49], 0x183, 0x01, 0x186A0, }, UnlockItem{ UnlockItemList[50], 0x184, 0x01, 0x186A0, }, UnlockItem{ UnlockItemList[51], 0x1FA, 0x01, 0x7530, }, UnlockItem{ UnlockItemList[52], 0x1FB, 0x01, 0xC350, }, UnlockItem{ UnlockItemList[53], 0x1FC, 0x01, 0x30D40, }, UnlockItem{ UnlockItemList[54], 0x207, 0x00, 0xA0, }, UnlockItem{ UnlockItemList[55], 0x208, 0x00, 0x104, }, UnlockItem{ UnlockItemList[56], 0x209, 0x00, 0x1E0, }, UnlockItem{ UnlockItemList[57], 0x20A, 0x00, 0x244, }, UnlockItem{ UnlockItemList[58], 0x258, 0x00, 0x244, }, UnlockItem{ UnlockItemList[59], 0x259, 0x00, 0x30C, }, UnlockItem{ UnlockItemList[60], 0x291, 0x01, 0x249F0, }, UnlockItem{ UnlockItemList[61], 0x292, 0x01, 0x75300, }, UnlockItem{ UnlockItemList[62], 0x293, 0x01, 0x35B60, }, UnlockItem{ UnlockItemList[63], 0x294, 0x00, 0x140, }, UnlockItem{ UnlockItemList[64], 0x295, 0x00, 0x208, }, UnlockItem{ UnlockItemList[65], 0x31F, 0x00, 0x208, }, UnlockItem{ UnlockItemList[66], 0x3A4, 0x01, 0x493E0, }, UnlockItem{ UnlockItemList[67], 0x444, 0x01, 0x3A980, }, UnlockItem{ UnlockItemList[68], 0x445, 0x01, 0x57E40, }, UnlockItem{ UnlockItemList[69], 0x446, 0x01, 0x75300, }, UnlockItem{ UnlockItemList[70], 0x4A9, 0x01, 0x249F0, }, UnlockItem{ UnlockItemList[71], 0x4AA, 0x01, 0x30D40, }, UnlockItem{ UnlockItemList[72], 0x4FC, 0x01, 0x9942, }, UnlockItem{ UnlockItemList[73], 0x4FD, 0x01, 0x22986, }, UnlockItem{ UnlockItemList[74], 0x4FE, 0x01, 0x2ED8C, }, } )
View Source
var ( //UsersManager 全局用户管理 UsersManager = UManager{ 0, map[uint32]*User{}, usersManagerLock, } MaxUsers uint32 = 0 )
View Source
var (
DefaultInventoryItem = []UserInventoryItem{}
)
Functions ¶
func ReadSubMenu ¶
Types ¶
type ChannelInfo ¶
type ChannelInfo struct {
ChannelID uint8
ChannelName []byte
Unk00 uint16
Unk01 uint16
Unk02 uint8
ChannelType uint8
ChannelStatus uint8
NextRoomID uint8
RoomNum uint16
Rooms map[uint16]*Room
RoomNums map[uint8]uint16
ChannelMutex *sync.Mutex
}
频道信息,隶属于分区服务器,用于请求服务器和请求频道
type ChannelServer ¶
type ChannelServer struct {
ServerIndex uint8
ServerStatus uint8
ServerType uint8
ServerName []byte
ChannelCount uint8
Channels []*ChannelInfo
}
分区服务器,管理所拥有的频道
type InAchievementCampaignPacket ¶ added in v0.3.11
type InAchievementCampaignPacket struct {
CampaignId uint16
}
type InAchievementPacket ¶ added in v0.3.11
type InAchievementPacket struct {
Type uint8
}
type InAssistPacket ¶
type InChangeTeamPacket ¶
type InChangeTeamPacket struct {
NewTeam uint8
}
type InChatPacket ¶ added in v0.3.8
type InDeathPacket ¶
type InFavoritePacket ¶
type InFavoritePacket struct {
PacketType uint8
}
type InFavoriteSetCosmetics ¶
type InFavoriteSetLoadout ¶
type InFeedbackPacket ¶ added in v0.3.11
type InFeedbackPacket struct {
ErrorCode uint16
// contains filtered or unexported fields
}
type InGameScorePacket ¶
type InHostBuyItemPacket ¶ added in v0.3.11
type InHostDataCachePacket ¶ added in v0.3.15
type InHostDataPacket ¶ added in v0.3.15
type InHostDataPacket struct {
DataType uint8
}
type InHostDataUsersPacket ¶ added in v0.3.15
type InHostItemUsingPacket ¶ added in v0.3.11
type InHostPacket ¶
type InHostPacket struct {
InHostType uint8
}
type InHostSetBuyMenu ¶
type InHostSetBuyMenu struct {
Userid uint32
}
type InHostSetInventoryPacket ¶
type InHostSetInventoryPacket struct {
UserID uint32
}
type InHostSetLoadoutPacket ¶
type InHostSetLoadoutPacket struct {
UserID uint32
}
type InJoinRoomPacket ¶
type InKillPacket ¶
type InLoginPacket ¶
type InLoginPacket struct {
LenOfNexonUsername uint8
NexonUsername []byte //假定nexonUsername是唯一
LenOfGameUsername uint8
GameUsername []byte
Unknown01 uint8
LenOfPassWd uint16
PassWd []byte
//HddHwid 16 bytes
HddHwid []byte
//netCafeID 4 bytes
NetCafeID uint32
Unknown02 uint32
UserSn uint64
LenOfUnknownString uint16
UnknownString03 []byte
Unknown04 uint8
IsLeague uint8
LenOfString uint8
String []byte
}
type InMailListPacket ¶ added in v0.3.14
type InMailListPacket struct {
InType uint8
}
type InMailPacket ¶ added in v0.3.14
type InMailPacket struct {
InMailType uint8
}
type InNewRoomPacket ¶
type InNewRoomPacket struct {
LenOfName uint8
RoomName []byte
Unk00 uint16
Unk01 uint8
GameModeID uint8
MapID uint8
WinLimit uint8
KillLimit uint16
Unk02 uint8
Unk03 uint8
Unk04 uint8
LenOfUnk05 uint8
Unk05 []byte
Unk06 uint8
Unk07 uint8
Unk08 uint8
Unk09 uint8
Unk10 uint8
Unk11 uint32
}
InNewRoomPacket 新建房间时传进来的数据包
type InOpenBoxPacket ¶ added in v0.3.15
type InOptionBuyMenu ¶
type InOptionPacket ¶
type InOptionPacket struct {
OptionPacketType uint8
}
type InPlayerInfoPacket ¶
type InPlayerInfoPacket struct {
InfoType uint8
}
type InPointLottoPacket ¶ added in v0.4.0
type InPointLottoPacket struct {
Type uint8
}
type InPointLottoUsePacket ¶ added in v0.4.0
type InPointLottoUsePacket struct {
ItemSeq uint16
// contains filtered or unexported fields
}
type InQuickList ¶
type InQuickPacket ¶
type InQuickPacket struct {
InQuickType uint8
}
type InReportMsgPacket ¶ added in v0.3.13
type InReportPacket ¶ added in v0.3.13
type InReportPacket struct {
Type uint8
}
type InReportSearchUserPacket ¶ added in v0.3.13
type InRevivedPacket ¶
type InRoomCountdownPacket ¶
func (InRoomCountdownPacket) ShouldCountdown ¶
func (p InRoomCountdownPacket) ShouldCountdown() bool
type InRoomListRequestPacket ¶
InRoomListRequestPacket 房间列表请求,用于请求频道
type InSetAvatarPacket ¶
type InSetAvatarPacket struct {
AvatarId uint16
}
type InSetCampaignPacket ¶ added in v0.3.11
type InSetSignaturePacket ¶
type InSetTitlePacket ¶
type InSetTitlePacket struct {
TitleId uint16
}
type InShopBuyItemPacket ¶ added in v0.4.0
type InShopBuyItemPacket struct {
ItemID uint32
}
type InShopPacket ¶ added in v0.3.11
type InShopPacket struct {
InShopType uint8
}
type InSupplyPacket ¶ added in v0.3.15
type InSupplyPacket struct {
Type uint8
}
type InUDPmsg ¶
type InUDPmsg struct {
Signature uint8
UserId uint32
PortId uint16
IpAddress uint32
Port uint16
PacketData []byte
Datalen int
CurOffset int //可能32位
ParsedSuccessfully bool
}
func (InUDPmsg) IsHeartbeat ¶
type InUpSettingReq ¶
type InUpSettingReq struct {
Flags uint64
LenOfRoomName uint8
RoomName []byte
Unk00 uint8
Unk01 uint8
Unk02 uint32
Unk03 uint32
LenOfpasswd uint8
Passwd []byte
Unk10 uint16
ForceCamera uint8
GameModeID uint8
MapID uint8
Unk13 uint8
MaxPlayers uint8
WinLimit uint8
KillLimit uint16
Unk17 uint8
Unk18 uint8
WeaponRestrictions uint8
Status uint8
Unk21 uint8
MapCycleType uint8
Unk23 uint8
Unk24 uint8
Unk25 uint8
NumOfMultiMaps uint8
MultiMaps []uint8
TeamBalanceType uint8
Unk29 uint8
Unk30 uint8
Unk31 uint8
Unk32 uint8
Unk33 uint8
BotEnabled uint8
BotDifficulty uint8
NumCtBots uint8
NumTrBots uint8
Unk35 uint8
Unk36 uint8
Unk37 uint8
Unk38 uint8
Unk39 uint8
IsIngame uint8
StartMoney uint16
ChangeTeams uint8
Unk43 uint8
HltvEnabled uint8
Unk45 uint8
RespawnTime uint8
}
type InWeaponPointArray ¶ added in v0.3.11
type InWeaponPointArray struct {
// contains filtered or unexported fields
}
type InWeaponPointPacket ¶ added in v0.3.11
type InWeaponPointPacket struct {
KillType uint32
KillerID uint32
KillerWeaponID uint32
KillerTeam uint8
KillerClientType uint8
KillerCharacterType uint8
KillerCharacterClass uint32
DeadType uint32
VictimID uint32
VictimWeaponID uint32
VictimTeam uint8
VictimClientType uint8
VictimCharacterType uint8
VictimCharacterClass uint32
KillerX uint32
KillerY uint32
KillerZ uint32
VictimX uint32
VictimY uint32
VictimZ uint32
ArraySize uint16 //待定
Array []InWeaponPointArray
}
type OutAchievementCampaign ¶ added in v0.3.11
type OutAchievementCampaign struct {
Unk00 uint16
Unk01 uint32
RewardTitle uint16
RewardIcon uint16
RewardPoints uint32
RewardXp uint32
NumOfItems uint8
Items []OutAchievementCampaignItems
Unk02 uint16
}
OutAchievementCampaign from l-leite
type OutAchievementCampaignItems ¶ added in v0.3.11
type OutAchievementCampaignItems struct {
ItemId uint32
Ammount uint16
TimeLimited uint16 // 1 and 0
}
OutAchievementCampaignItems from l-leite
type OutLobbyJoinRoom ¶
未知,用于请求频道
type PacketData ¶
PacketData ,data part of packet
func (*PacketData) PraseChangeTeamPacket ¶
func (p *PacketData) PraseChangeTeamPacket(dest *InChangeTeamPacket) bool
func (*PacketData) PraseChannelRequest ¶
func (p *PacketData) PraseChannelRequest(dest *InRoomListRequestPacket) bool
func (*PacketData) PraseFavoritePacket ¶
func (p *PacketData) PraseFavoritePacket(dest *InFavoritePacket) bool
func (*PacketData) PraseFavoriteSetCosmeticsPacket ¶
func (p *PacketData) PraseFavoriteSetCosmeticsPacket(dest *InFavoriteSetCosmetics) bool
func (*PacketData) PraseFavoriteSetLoadoutPacket ¶
func (p *PacketData) PraseFavoriteSetLoadoutPacket(dest *InFavoriteSetLoadout) bool
func (*PacketData) PraseHostPacket ¶
func (p *PacketData) PraseHostPacket(dest *InHostPacket) bool
func (*PacketData) PraseInAchievementCampaignPacket ¶ added in v0.3.11
func (p *PacketData) PraseInAchievementCampaignPacket(dest *InAchievementCampaignPacket) bool
func (*PacketData) PraseInAchievementPacket ¶ added in v0.3.11
func (p *PacketData) PraseInAchievementPacket(dest *InAchievementPacket) bool
func (*PacketData) PraseInAssistPacket ¶
func (p *PacketData) PraseInAssistPacket(dest *InAssistPacket) bool
func (*PacketData) PraseInChatPacket ¶ added in v0.3.8
func (p *PacketData) PraseInChatPacket(dest *InChatPacket) bool
func (*PacketData) PraseInDeathPacket ¶
func (p *PacketData) PraseInDeathPacket(dest *InDeathPacket) bool
func (*PacketData) PraseInGameScorePacket ¶
func (p *PacketData) PraseInGameScorePacket(dest *InGameScorePacket) bool
func (*PacketData) PraseInHostBuyItemPacket ¶ added in v0.3.11
func (p *PacketData) PraseInHostBuyItemPacket(dest *InHostBuyItemPacket) bool
func (*PacketData) PraseInHostDataCachePacket ¶ added in v0.3.15
func (p *PacketData) PraseInHostDataCachePacket(dest *InHostDataCachePacket) bool
func (*PacketData) PraseInHostDataPacket ¶ added in v0.3.15
func (p *PacketData) PraseInHostDataPacket(dest *InHostDataPacket) bool
func (*PacketData) PraseInHostDataUsersPacket ¶ added in v0.3.15
func (p *PacketData) PraseInHostDataUsersPacket(dest *InHostDataUsersPacket) bool
func (*PacketData) PraseInHostItemUsingPacket ¶ added in v0.3.11
func (p *PacketData) PraseInHostItemUsingPacket(dest *InHostItemUsingPacket) bool
func (*PacketData) PraseInKillPacket ¶
func (p *PacketData) PraseInKillPacket(dest *InKillPacket) bool
func (*PacketData) PraseInQuickListPacket ¶
func (p *PacketData) PraseInQuickListPacket(dest *InQuickList) bool
func (*PacketData) PraseInRevivedPacket ¶
func (p *PacketData) PraseInRevivedPacket(dest *InRevivedPacket) bool
func (*PacketData) PraseInTeamChangingPacket ¶
func (p *PacketData) PraseInTeamChangingPacket(dest *InHostTeamChangingPacket) bool
func (*PacketData) PraseInWeaponPointPacket ¶ added in v0.3.11
func (p *PacketData) PraseInWeaponPointPacket(dest *InWeaponPointPacket) bool
func (*PacketData) PraseJoinRoomPacket ¶
func (p *PacketData) PraseJoinRoomPacket(dest *InJoinRoomPacket) bool
func (*PacketData) PraseLoginPacket ¶
func (dataPacket *PacketData) PraseLoginPacket(p *InLoginPacket) bool
func (*PacketData) PraseMailListPacket ¶ added in v0.3.14
func (p *PacketData) PraseMailListPacket(dest *InMailListPacket) bool
func (*PacketData) PraseMailPacket ¶ added in v0.3.14
func (p *PacketData) PraseMailPacket(dest *InMailPacket) bool
func (*PacketData) PraseNewRoomQuest ¶
func (p *PacketData) PraseNewRoomQuest(dest *InNewRoomPacket) bool
func (*PacketData) PraseOpenBoxPacket ¶ added in v0.3.15
func (p *PacketData) PraseOpenBoxPacket(dest *InOpenBoxPacket) bool
func (*PacketData) PraseOptionPacket ¶
func (p *PacketData) PraseOptionPacket(dest *InOptionPacket) bool
func (*PacketData) PrasePlayerInfoPacket ¶
func (p *PacketData) PrasePlayerInfoPacket(dest *InPlayerInfoPacket) bool
func (*PacketData) PrasePointLottoPacket ¶ added in v0.4.0
func (p *PacketData) PrasePointLottoPacket(dest *InPointLottoPacket) bool
func (*PacketData) PrasePointLottoUsePacket ¶ added in v0.4.0
func (p *PacketData) PrasePointLottoUsePacket(dest *InPointLottoUsePacket) bool
func (*PacketData) PraseQuickPacket ¶
func (p *PacketData) PraseQuickPacket(dest *InQuickPacket) bool
func (*PacketData) PraseReportMsgPacket ¶ added in v0.3.13
func (p *PacketData) PraseReportMsgPacket(dest *InReportMsgPacket) bool
func (*PacketData) PraseReportPacket ¶ added in v0.3.13
func (p *PacketData) PraseReportPacket(dest *InReportPacket) bool
func (*PacketData) PraseReportSearchUserPacket ¶ added in v0.3.13
func (p *PacketData) PraseReportSearchUserPacket(dest *InReportSearchUserPacket) bool
func (*PacketData) PraseRoomCountdownPacket ¶
func (p *PacketData) PraseRoomCountdownPacket(dest *InRoomCountdownPacket) bool
func (*PacketData) PraseRoomFeedbackPacket ¶ added in v0.3.11
func (p *PacketData) PraseRoomFeedbackPacket(dest *InFeedbackPacket) bool
func (*PacketData) PraseRoomPacket ¶
func (p *PacketData) PraseRoomPacket(dest *InRoomPaket) bool
func (*PacketData) PraseSaveBuyMenu ¶
func (p *PacketData) PraseSaveBuyMenu(dest *InOptionBuyMenu) bool
func (*PacketData) PraseSetAvatarPacket ¶
func (p *PacketData) PraseSetAvatarPacket(dest *InSetAvatarPacket) bool
func (*PacketData) PraseSetBuyMenuPacket ¶
func (p *PacketData) PraseSetBuyMenuPacket(dest *InHostSetBuyMenu) bool
func (*PacketData) PraseSetCampaignPacket ¶ added in v0.3.11
func (p *PacketData) PraseSetCampaignPacket(dest *InSetCampaignPacket) bool
func (*PacketData) PraseSetSignaturePacket ¶
func (p *PacketData) PraseSetSignaturePacket(dest *InSetSignaturePacket) bool
func (*PacketData) PraseSetTitlePacket ¶
func (p *PacketData) PraseSetTitlePacket(dest *InSetTitlePacket) bool
func (*PacketData) PraseSetUserInventoryPacket ¶
func (p *PacketData) PraseSetUserInventoryPacket(dest *InHostSetInventoryPacket) bool
func (*PacketData) PraseSetUserLoadoutPacket ¶
func (p *PacketData) PraseSetUserLoadoutPacket(dest *InHostSetLoadoutPacket) bool
func (*PacketData) PraseShopBuyItemPacket ¶ added in v0.4.0
func (p *PacketData) PraseShopBuyItemPacket(dest *InShopBuyItemPacket) bool
func (*PacketData) PraseShopPacket ¶ added in v0.3.11
func (p *PacketData) PraseShopPacket(dest *InShopPacket) bool
func (*PacketData) PraseSupplyPacket ¶ added in v0.3.15
func (p *PacketData) PraseSupplyPacket(dest *InSupplyPacket) bool
func (*PacketData) PraseUpdateRoomPacket ¶
func (p *PacketData) PraseUpdateRoomPacket(dest *InUpSettingReq) bool
type PacketHeader ¶
PacketHeader ,header of packet , 4 bytes len
func (*PacketHeader) PraseHeadPacket ¶
func (p *PacketHeader) PraseHeadPacket()
type Room ¶
type Room struct {
Id uint16
//Flags uint64
RoomNumber uint8
PasswordProtected uint8
Unk08 uint8
HostUserID uint32
HostUserName []byte
Unk11 uint8
Unk12 uint8
Unk13 uint32
Unk14 uint16
Unk15 uint16
Unk16 uint32
Unk17 uint16
Unk18 uint16
Unk19 uint8
Unk20 uint8
Unk21 uint8
Unk24 uint8
Unk26 uint8
Unk27 []uint8
Unk28 uint8
Unk29 uint8
Unk30 uint64
Unk31 uint8
Unk35 uint8
AreFlashesDisabled uint8
CanSpec uint8
IsVipRoom uint8
VipRoomLevel uint8
//设置
Setting RoomSettings
CountingDown bool
Countdown uint8
NumPlayers uint8
Users map[uint32]*User
ParentChannel uint8
CtScore uint8
TrScore uint8
CtKillNum uint32
TrKillNum uint32
WinnerTeam uint8
Cache []byte
PageNum uint8
RoomMutex *sync.Mutex
}
房间信息
func (Room) CanStartGame ¶
func (*Room) CheckIngameStatus ¶
func (rm *Room) CheckIngameStatus()
func (*Room) CountRoomCtKill ¶
func (rm *Room) CountRoomCtKill()
func (*Room) CountRoomTrKill ¶
func (rm *Room) CountRoomTrKill()
func (Room) FindDesirableTeam ¶
func (Room) GetAllCtNum ¶
func (Room) GetAllTrNum ¶
func (*Room) GetCountdown ¶
func (Room) GetFreeSlots ¶
func (Room) GetNumOfReadyPlayers ¶
func (Room) GetNumOfRealIngamePlayers ¶ added in v0.3.13
func (Room) GetNumOfRealReadyPlayers ¶
func (Room) IsGlobalCountdownInProgress ¶
func (*Room) ProgressCountdown ¶
func (*Room) ResetRoomKillNum ¶
func (rm *Room) ResetRoomKillNum()
func (*Room) ResetRoomScore ¶
func (rm *Room) ResetRoomScore()
func (*Room) ResetRoomWinner ¶
func (rm *Room) ResetRoomWinner()
func (Room) RoomGetUser ¶
func (*Room) RoomRemoveUser ¶
func (*Room) RoomSaveCache ¶ added in v0.3.15
func (*Room) SetRoomHost ¶ added in v0.3.1
func (*Room) SetRoomScore ¶
func (*Room) SetRoomWinner ¶
func (*Room) StopCountdown ¶
func (rm *Room) StopCountdown()
func (*Room) SyncUserNum ¶ added in v0.3.15
func (*Room) ToUpdateSetting ¶
func (dest *Room) ToUpdateSetting(src *InUpSettingReq)
type RoomSettings ¶
type RoomSettings struct {
LenOfName uint8
RoomName []byte
Unk00 uint8
Unk01 uint8
Unk02 uint32
Unk03 uint32
LenOfPassWd uint8
PassWd []byte
Unk10 uint16
ForceCamera uint8
GameModeID uint8
MapID uint8
Unk13 uint8
MaxPlayers uint8
WinLimit uint8
KillLimit uint16
Unk17 uint8
Unk18 uint8
WeaponRestrictions uint8
Status uint8
Unk21 uint8
MapCycleType uint8
Unk23 uint8
Unk24 uint8
Unk25 uint8
LenOfMultiMaps uint8
MultiMaps []byte
TeamBalanceType uint8
Unk29 uint8
Unk30 uint8
Unk31 uint8
Unk32 uint8
Unk33 uint8
AreBotsEnabled uint8
BotDifficulty uint8
NumCtBots uint8
NumTrBots uint8
Unk35 uint8
Unk36 uint8
Unk37 uint8
Unk38 uint8
Unk39 uint8
StartMoney uint16
ChangeTeams uint8
Unk43 uint8
HltvEnabled uint8
Unk45 uint8
RespawnTime uint8
NextMapEnabled uint8
Difficulty uint8
IsIngame uint8
}
每个房间的设置数据
type ServerManager ¶
type ServerManager struct {
ServerNum uint8
Servers []*ChannelServer
}
主服务器,管理各个分区
type UnlockItem ¶ added in v0.3.7
type UnlockKillNum ¶ added in v0.3.7
type User ¶
type User struct {
//个人信息
CheckUpdate int
Userid uint32 `json:"-"`
NexonID uint64
UserName string
IngameName string
Password []byte
Gm uint8
Level uint16
Rank uint8
RankFrame uint8
Points uint64
CurrentExp uint64
MaxExp uint64
PlayedMatches uint32
Wins uint32
Kills uint32
Headshots uint32
Deaths uint32
Assists uint32
Accuracy uint16
SecondsPlayed uint32
NetCafeName []byte
Cash uint32
ClanName []byte
ClanMark uint32
WorldRank uint32
Campaign uint16
Mpoints uint32
TitleId uint16
UnlockedTitles []byte
Signature []byte
UnreadedMsg uint8
BestGamemode uint32
BestMap uint32
UnlockedAchievements []byte
Avatar uint16
UnlockedAvatars []byte
VipLevel uint8
VipXp uint32
SkillHumanCurXp uint64
SkillHumanMaxXp uint64
SkillHumanPoints uint8
SkillZombieCurXp uint64
SkillZombieMaxXp uint64
SkillZombiePoints uint8
UserMail string
//连接
CurrentConnection net.Conn `json:"-"`
//频道房间信息
CurrentChannelServerIndex uint8 `json:"-"`
CurrentChannelIndex uint8 `json:"-"`
CurrentRoomId uint16 `json:"-"`
CurrentTeam uint8 `json:"-"`
Currentstatus uint8 `json:"-"`
CurrentIsIngame bool `json:"-"`
CurrentSequence *uint8 `json:"-"`
CurrentKillNum uint16 `json:"-"`
CurrentDeathNum uint16 `json:"-"`
CurrentAssistNum uint16 `json:"-"`
NetInfo UserNetInfo `json:"-"`
//仓库信息
Inventory UserInventory
WeaponKills map[uint32]uint32
UserMutex *sync.Mutex `json:"-"`
}
func GetNewUser ¶
func GetNewUser() User
func (*User) AddItemSingle ¶ added in v0.4.0
func (*User) AddMatches ¶ added in v0.3.5
func (u *User) AddMatches()
func (*User) BuildUserNetInfo ¶
func (*User) CountAssistNum ¶
func (u *User) CountAssistNum()
func (*User) CountDeadNum ¶
func (*User) CountKillNum ¶
func (*User) CountWeaponKill ¶ added in v0.3.11
func (*User) DecreaseItem ¶ added in v0.3.15
func (*User) GetAssists ¶ added in v0.3.5
func (*User) GetDeathes ¶ added in v0.3.5
func (*User) GetItemIDBySeq ¶ added in v0.4.0
func (User) GetUserChannelServerID ¶
GetUserChannelServerID 获取用户所在分区服务器ID
func (User) GetUserTeam ¶
func (User) IsUserReady ¶
func (*User) PunishPoints ¶ added in v0.3.5
func (u *User) PunishPoints()
func (*User) QuitChannel ¶
func (u *User) QuitChannel()
func (*User) RemoveItem ¶ added in v0.3.15
func (*User) ResetAssistNum ¶
func (u *User) ResetAssistNum()
func (*User) ResetDeadNum ¶
func (u *User) ResetDeadNum()
func (*User) ResetKillNum ¶
func (u *User) ResetKillNum()
func (*User) SetBuyMenu ¶
func (u *User) SetBuyMenu(menu UserBuyMenu)
func (*User) SetInventoryItems ¶ added in v0.3.15
func (u *User) SetInventoryItems(items *[]UserInventoryItem)
func (*User) SetNewMutex ¶ added in v0.3.11
func (u *User) SetNewMutex()
func (*User) SetSignature ¶
func (*User) SetUserChannel ¶
func (*User) SetUserChannelServer ¶
func (*User) SetUserIngame ¶
func (*User) SetUserName ¶
func (*User) SetUserRoom ¶
func (*User) SetUserStatus ¶
func (*User) SetUserTeam ¶
func (*User) UpdateCampaign ¶ added in v0.3.11
func (*User) UpdateHolepunch ¶
func (*User) UseCredits ¶ added in v0.4.0
func (*User) UseMPoints ¶ added in v0.4.0
type UserBuyMenu ¶
type UserBuyMenu struct {
Pistols []uint32
Shotguns []uint32
Smgs []uint32
Rifles []uint32
Snipers []uint32
Machineguns []uint32
Melees []uint32
Equipment []uint32
}
UserBuyMenu 用户的购买菜单
func CreateDefaultUserBuyMenu ¶ added in v0.3.7
func CreateDefaultUserBuyMenu() UserBuyMenu
func CreateFullUserBuyMenu ¶ added in v0.3.7
func CreateFullUserBuyMenu() UserBuyMenu
type UserInfo ¶
type UserInfo struct {
//flags uint32 // should always be 0xFFFFFFFF for a full update
NexonID uint64 // nexon id?
Title uint16
// contains filtered or unexported fields
}
发送出去的包结构,其中一些未知,知道后会加入user里去
func NewUserInfo ¶
type UserInventory ¶
type UserInventory struct {
NumOfItem uint16 //物品数量
Items []UserInventoryItem //物品
CTModel uint32 //当前的CT模型
TModel uint32 //当前的T模型
HeadItem uint32 //当前的头部装饰
GloveItem uint32 //当前的手套
BackItem uint32 //当前的背部物品
StepsItem uint32 //当前的脚步效果
CardItem uint32 //当前的卡片
SprayItem uint32 //当前的喷漆
BuyMenu UserBuyMenu //购买菜单
Loadouts []UserLoadout
}
func CreateNewUserInventory ¶
func CreateNewUserInventory() UserInventory
type UserInventoryItem ¶
type UserLoadout ¶
type UserLoadout struct {
Items []uint32
}
func CreateDefaultLoadout ¶ added in v0.3.7
func CreateDefaultLoadout() []UserLoadout
func CreateFullLoadout ¶ added in v0.3.7
func CreateFullLoadout() []UserLoadout
Source Files
¶
Click to show internal directories.
Click to hide internal directories.