public static bool init() { SDGlobal.Log("sdLevelMsg.init"); /* 推图数据 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_LEVEL_ACK, OnMessage_SCID_LEVEL_ACK); return(true); }
private static void OnMessage_GCID_SELECTROLE(int iMsgID, ref CMessage msg) { SDGlobal.Log("GC_SELECTROLE"); if (SDNetGlobal.bReConnectGate) { SDNetGlobal.OnMessage_GCID_SELECTROLE(iMsgID, ref msg); return; } //游戏中宠物,邮件,深渊活动等管理器,数据在这里清空一下.. sdNewPetMgr.Instance.ClearData(); SDGlobal.Log("sdNewPetMgr.ClearData success!"); sdActGameMgr.Instance.ClearData(); SDGlobal.Log("sdActGameMgr.ClearData success!"); sdMailMgr.Instance.ClearData(); SDGlobal.Log("sdMailMgr.ClearData success!"); sdGuideMgr.Instance.ClearData(); sdLevelInfo.Clear(); string rolename = SDNetGlobal.playerList[SDNetGlobal.lastSelectRole].mRoleName; GPUSH_API.SetUserInfo(0, rolename); }
public static bool init() { SDGlobal.Log("sdPVPMsg.init"); /* 角色PVP信息 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SELF_PVP_PRO_ACK, msg_SC_SELF_PVP_PRO_ACK); /* 获取pvp对手回应 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_PVP_MATCH_ACK, msg_SC_GET_PVP_MATCH_ACK); /* 挑战反馈 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ENTER_PVP_ACK, msg_SC_ENTER_PVP_ACK); /* PVP结算反馈 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PVP_RETULT_ACK, msg_SC_PVP_RESULT_ACK); /* 获取军阶奖励反馈 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_PVP_MILITARY_REWARD_ACK, msg_SC_GET_PVP_MILITARY_REWARD_ACK); /* 获取声望奖励反馈 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_PVP_REPUTE_REWARD_ACK, msg_SC_GET_PVP_RETURN_REWARD_ACK); /* 获取排行榜反馈 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_RANK_LIST_ACK, msg_SC_GET_RANK_LIST_ACK); /* 买挑战次数反馈 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PVP_BUY_CHALLENGE_TIMES_ACK, msg_SC_PVP_BUY_CHALLENGE_TIMES_ACK); /* 通知pvp时间 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PVP_TIME_NTF, msg_SC_PVP_TIME_ACK); /* 获取PVP角色信息请求 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_PVP_ROLE_INFO_ACK, msg_SC_GET_PVP_ROLE_INFO_ACK); return(true); }
//宠物物品列表.. private static void msg_SC_PET_BAG_NTF(int iMsgID, ref CMessage msg) { CliProto.SC_PET_BAG_NTF refMsg = (CliProto.SC_PET_BAG_NTF)msg; SDGlobal.Log("<- SCID_PET_BAG_NTF : "); sdNewPetMgr.Instance.petItemDB.Clear(); int count = refMsg.m_Items.m_ItemCount; for (int i = 0; i < count; ++i) { sdNewPetMgr.Instance.createItem((int)refMsg.m_Items.m_Items[i].m_TID, (UInt64)refMsg.m_Items.m_Items[i].m_UID, (int)refMsg.m_Items.m_Items[i].m_CT); } GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIPetEquipPnl petEquipPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petEquipPnl) { petEquipPnl.RefreshPetItemListPage(); } sdUIPetChangeEquipPnl petEquipPnl2 = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>(); if (petEquipPnl2) { petEquipPnl2.RefreshPetItemListPage(); } } }
public static void OnMessage_LGPKG_LOGIN_ACK(CliProto.LGPKG_LOGIN_ACK refMSG) { client.DisConnect(); if (refMSG.m_AckType == CliProto.LG_FAIL) { sdUICharacter.Instance.ShowLoginMsg(SGDP.ErrorString((uint)refMSG.m_Reply.m_Fail.m_ErrCode)); if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.Login) { SDNetGlobal.connectState = -1; } return; } SDGlobal.Log("received"); Gate_IP = refMSG.m_Reply.m_Succ.m_GateInfo.m_ListenIP; Gate_Port = refMSG.m_Reply.m_Succ.m_GateInfo.m_ListenPort; byte[] session = refMSG.m_Reply.m_Succ.m_SessionID; username = new byte[refMSG.m_Reply.m_Succ.m_Username.Length]; for (int i = 0; i < refMSG.m_Reply.m_Succ.m_Username.Length; i++) { username[i] = refMSG.m_Reply.m_Succ.m_Username[i]; } for (int i = 0; i < 8; i++) { gateSession[i] = session[i]; } doGateLogin(false); Thread threadHeart = new Thread(new ThreadStart(HeartBeatMain)); threadHeart.Start(); }
//物品碎片列表.. private static void msg_SC_GATHER_INFO_NTF(int iMsgID, ref CMessage msg) { CliProto.SC_GATHER_INFO_NTF refMsg = (CliProto.SC_GATHER_INFO_NTF)msg; SDGlobal.Log("<- SCID_GATHER_INFO_NTF : "); sdNewPetMgr.Instance.CreatePetGatherList(refMsg); GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIPetTujianPnl petPnl = wnd.GetComponentInChildren <sdUIPetTujianPnl>(); if (petPnl) { petPnl.RefreshPetBookPage(); } sdUIPetPropPnl petProp = wnd.GetComponentInChildren <sdUIPetPropPnl>(); if (petProp) { petProp.ReflashGatherUI(); } sdUIPetPaperPnl petPaper = wnd.GetComponentInChildren <sdUIPetPaperPnl>(); if (petPaper) { petPaper.RefreshPetPaperPage(); } } }
void GetGHomeProductList() { GHome.GetInstance().GetProductConfig((code, msg, data) => { if (code == 0) { sdMallManager.Instance.m_gHomeProducts.Clear(); string json = (string)data["data"]; JsonNode jsonNODE = new JsonNode(); int iPOS = 0; jsonNODE.Parse(json, ref iPOS); List <JsonNode> lstAREA = new List <JsonNode>(); jsonNODE.FindListHasAttibuteName("product_code", lstAREA); foreach (JsonNode js in lstAREA) { sdMallManager.GHomeProduct gHomeProduct = new sdMallManager.GHomeProduct(); gHomeProduct.ProductCode = js.Attribute("product_code"); gHomeProduct.ItemName = js.Attribute("item_name"); gHomeProduct.price = int.Parse(js.Attribute("money")); gHomeProduct.type = int.Parse(js.Attribute("type")); sdMallManager.Instance.m_gHomeProducts.Add(gHomeProduct.ProductCode, gHomeProduct); } GHOME_CODE = 1; } else { SDGlobal.Log("GHome.GetInstance().GetProductConfig() failure"); GHOME_CODE = -2; } }); }
public static bool init() { SDGlobal.Log("sdChatMsg.init"); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_CHAT, msg_SCID_CHAT); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_CLIENT_CONFIG_NTF, msg_SCID_CLIENT_CONFIG_NTF); return(true); }
public static void init() { CliProto.AddEncode_Decode(); if (Application.platform != RuntimePlatform.WindowsEditor) { Login_IP = "127.0.0.1"; } else { // 只有在内网172网段才使用内网服务器地址.. 并且不是移动平台.. string ip = Network.player.ipAddress; int idx = ip.IndexOf('.'); // !!! // 请在login场景的bt_startgame按钮的属性表里设置Serverip,不要直接修改这个脚本 // !!! if (idx > 0 && ip.Substring(0, idx) == "172" && (!BundleGlobal.IsMobile() || BundleGlobal.InternalNetDebug)) { Login_IP = "172.30.10.124"; bInternalNet = true; } else { Login_IP = "127.0.0.1"; } } Login_Port = 8000; setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.GCID_ERROR, OnMessage_GCID_ERROR); SDGlobal.Log("before enterscene"); sdEnterScene.init(); SDGlobal.Log("before item Msg"); sdItemMsg.init(); SDGlobal.Log("itemMsg"); sdSkillMsg.init(); SDGlobal.Log("actorMsg"); sdActorMsg.init(); SDGlobal.Log("petMsg"); sdPetMsg.init(); SDGlobal.Log("chat"); sdChatMsg.init(); SDGlobal.Log("friend"); sdFriendMsg.init(); SDGlobal.Log("ActGameMsg"); sdActGameMsg.init(); sdMallMsg.init(); SDGlobal.Log("MailMsg"); sdMailMsg.init(); SDGlobal.Log("pvpMsg"); sdPVPMsg.init(); SDGlobal.Log("AwardCenterMsg"); sdAwardCenterMsg.init(); SDGlobal.Log("RoleCreateMsg"); sdRoleCreateMsg.init(); sdMysteryShopMsg.init(); sdRankLisrMsg.init(); sdBBSMsg.init(); sdLevelMsg.init(); }
public static void OnMessage_GCID_ROLELIST(int iMsgID, ref CMessage msg) { SDGlobal.Log("rolelist received"); CliProto.GC_ROLELIST refMSG = (CliProto.GC_ROLELIST)msg; SDNetGlobal.roleCount = refMSG.m_Count; if (!SDNetGlobal.bReConnectGate) { SDNetGlobal.lastSelectRole = SelectRole.SortRoleList(refMSG); } for (int i = 0; i < SDNetGlobal.roleCount; i++) { if (SDNetGlobal.playerList[i] == null) { SDNetGlobal.playerList[i] = new sdPlayerInfo(); } sdPlayerInfo kPlayerInfo = SDNetGlobal.playerList[i]; kPlayerInfo.mRoleName = System.Text.Encoding.UTF8.GetString(refMSG.m_RoleInfoList[i].m_RoleInfo.m_RoleName); kPlayerInfo.mDBID = refMSG.m_RoleInfoList[i].m_RoleInfo.m_DBRoleId; kPlayerInfo.mGender = refMSG.m_RoleInfoList[i].m_RoleInfo.m_Gender; kPlayerInfo.mSkinColor = refMSG.m_RoleInfoList[i].m_RoleInfo.m_SkinColor; kPlayerInfo.mHairStyle = refMSG.m_RoleInfoList[i].m_RoleInfo.m_HairStyle; kPlayerInfo.mBaseJob = refMSG.m_RoleInfoList[i].m_RoleInfo.m_BaseJob; kPlayerInfo.mJob = refMSG.m_RoleInfoList[i].m_RoleInfo.m_Job; kPlayerInfo.mLevel = refMSG.m_RoleInfoList[i].m_RoleInfo.m_Level; kPlayerInfo.mEquipCount = refMSG.m_RoleInfoList[i].m_Equip.m_ItemCount; if (kPlayerInfo.mEquipCount > 0) { kPlayerInfo.mEquipID = new uint[kPlayerInfo.mEquipCount]; for (int j = 0; j < kPlayerInfo.mEquipCount; ++j) { kPlayerInfo.mEquipID[j] = (uint)refMSG.m_RoleInfoList[i].m_Equip.m_Items[j].m_TID; } } } for (int i = SDNetGlobal.roleCount; i < 4; i++) { SDNetGlobal.playerList[i] = null; } SelectRole sr = sdGameLevel.instance.NGUIRoot.GetComponentInChildren <SelectRole>(); if (sr != null) { sr.OnRoleList(); } if (SDNetGlobal.bReConnectGate) { SDNetGlobal.OnMessage_GCID_ROLELIST(iMsgID, ref msg); } }
public static bool init() { SDGlobal.Log("sdSkillMsg.init"); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_USER_SKILLS_NTF, msg_SCID_USER_SKILLS_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SKILL_INFO_NTF, msg_SCID_SKILL_INFO_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_REMOVE_SKILL_NTF, msg_SCID_REMOVE_SKILL_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SKILL_POINT_NTF, msg_SCID_SKILL_POINT_NTF); return(true); }
public static bool init() { SDGlobal.Log("sdMysteryshopmsg.init"); /* 神秘商店购买物品返回 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SHOP_SECRET_BUY_ACK, msg_SC_SHOP_SECRET_BUY_ACK); /* 神秘商店物品列表返回 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SHOP_SECRET_GOODS_ACK, msg_SC_SHOP_SECRET_GOODS_ACK); return(true); }
public static bool notifyWantEnterScene(uint sceneId) { CliProto.CS_ENTERSCENE refMSG = new CliProto.CS_ENTERSCENE(); refMSG.m_SceneId = (uint)sdGlobalDatabase.Instance.globalData["SceneId"]; refMSG.m_Error = 0; //refMSG.szRoleName = System.Text.Encoding.Default.GetBytes(SDNetGlobal.playerList[selRole.currentSelect].name); SDNetGlobal.SendMessage(refMSG); SDGlobal.Log("-> CS_ENTERSCENE"); return(true); }
public static bool init() { SDGlobal.Log("sdRoleMsg.init"); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_OTHER_APPEAR, msg_SCID_OTHER_APPEAR); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_OTHER_DISAPPEAR, msg_SCID_OTHER_DISAPPEAR); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_OTHER_UPDATE, msg_SCID_OTHER_UPDATE); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_MOVE_BEGIN, msg_SCID_MOVE_BEGIN); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_MOVE_STOP, msg_SCID_MOVE_STOP); return(true); }
private static void ConnectGateLogin() { int Retry = 0; while (Retry < 10) { client.DisConnect(); client.Start(Gate_IP, Gate_Port); client.Connect(); connecting = false; if (client.IsConnect()) { SDGlobal.Log("Send gate"); connectState = 1; CliProto.CG_LOGIN MSG = new CliProto.CG_LOGIN(); for (int i = 0; i < 8; i++) { MSG.m_LoginData[i] = gateSession[i]; } MSG.m_PTID = username; MSG.m_LoginDataLen = 8; client.Send(MSG); gameLoginState = 2; return; } else { //if (!bReConnectGate) { if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.Login) { connectState = -1; return; } Retry++; gameLoginState = 100 + Retry; Debug.Log("Retry Time = " + Retry); } } //编辑器.. if (Application.platform == RuntimePlatform.WindowsEditor) { //break; } Debug.Log("Retry Connect Gate Server in 3 Second!"); Thread.Sleep(3000); } //connecting = false; gameLoginState = 3; // 连接失败,需要弹框问用户是否要重新连接.. Debug.Log("Connect Over"); }
public static bool init() { SDGlobal.Log("sdEnterScene.init"); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SELF_LOADSCENE, msg_SCID_SELF_LOADSCENE); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SELF_BASE_PRO, msg_SCID_SELF_BASE_PRO); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SELF_DATA_END, msg_SCID_SELF_DATA_END); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SELF_ENTERSCENE, msg_SCID_SELF_ENTERSCENE); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_TREASURE_CHEST_NTF, msg_SC_TREASURE_CHEST_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SELF_VOLATILE_PRO, msg_SCID_SELF_VOLATILE_PRO); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.GSID_SWITCHSCENE_REQ, msg_GSID_SWITCHSCENE); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ERROR_NTF, msg_SCID_ERROR_NTF); return(true); }
protected void MsgBoxOK() { if (baseUI.m_CurrentSelect < 0) { return; } // 向服务器请求删除角色 CliProto.CG_DELROLE refMSG = new CliProto.CG_DELROLE(); refMSG.m_RoleDBID = SDNetGlobal.playerList[baseUI.m_CurrentSelect].mDBID; SDNetGlobal.SendMessage(refMSG); SDGlobal.Log(SDNetGlobal.playerList[baseUI.m_CurrentSelect].mRoleName); }
private static void msg_SCID_SELF_ENTERSCENE(int iMsgID, ref CMessage msg) { CliProto.SC_SELF_ENTERSCENE refMSG = (CliProto.SC_SELF_ENTERSCENE)msg; SDGlobal.Log("<- SCID_SELF_ENTERSCENE : client start load scene!@ " + (System.DateTime.Now.Ticks / 10000L).ToString()); // 获取同步时间aa sdGameLevel gameLevel = sdGameLevel.instance; if (gameLevel != null) { //gameLevel.ServerTime = refMSG.m_ServerTime; //gameLevel.ClientTime = (ulong)(System.DateTime.Now.Ticks / 10000L);//Time.time; sdGlobalDatabase.Instance.ServerBeginTime = refMSG.m_ServerTime; } }
public static bool init() { SDGlobal.Log("sdActGameMsg.init"); //触发深渊.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ABYSS_TRIGGER_ACK, msg_SC_ABYSS_TRIGGER_ACK); //开启深渊ack.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ABYSS_OPEN_ACK, msg_SC_ABYSS_OPEN_ACK); //开启深渊ntf.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ABYSS_OPEN_NTF, msg_SC_ABYSS_OPEN_NTF); //可开启的深渊列表.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_ABYSS_TRIGGER_LIST_ACK, msg_SC_GET_ABYSS_TRIGGER_LIST_ACK); //可进入的深渊列表.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_ABYSS_OPEN_LIST_ACK, msg_SC_GET_ABYSS_OPEN_LIST_ACK); //深渊开启记录列表.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_ABYSS_OPEN_REC_ACK, msg_SC_GET_ABYSS_OPEN_REC_ACK); //请求进入深渊的返回ack.. //SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_LEVEL_ACK, msg_SC_LEVEL_ACK); //收到此协议,可进入深渊副本了.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ENTER_ABYSS_ACK, msg_SC_ENTER_ABYSS_ACK); //深渊结束,收到该协议需请求结算.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ABYSS_RUN_NTF, msg_SC_ABYSS_RUN_NTF); //返回角色选择界面.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.GSID_LEAVEGAME_ACK, msg_SC_LOGOUT); //世界BOSS相关协议.. //世界boss信息刷新反馈.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_WB_INFO_REFRESH_ACK, msg_SC_WB_INFO_REFRESH_ACK); //世界boss鼓舞buff反馈.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_WB_ADD_BUF_ACK, msg_SC_WB_ADD_BUF_ACK); //世界boss立即复活反馈.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_WB_RELIVE_ACK, msg_SC_WB_RELIVE_ACK); //世界boss被杀通知.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_WB_KILLED_NTF, msg_SC_WB_KILLED_NTF); //世界boss逃跑通知.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_WB_RUN_NTF, msg_SC_WB_RUN_NTF); //进入世界boss反馈.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_WB_ENTER_ACK, msg_SC_WB_ENTER_ACK); //世界boss结算反馈.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_WB_RESULT_ACK, msg_SC_WB_RESULT_ACK); //战魂试炼aa /* 获取战魂试炼基本信息回应 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GET_PT_BASEINFO_ACK, msg_SC_GET_PT_BASEINFO_ACK); /* 买挑战次数反馈 */ SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_BUY_PT_TIMES_ACK, msg_SC_BUY_PT_TIMES_ACK); return(true); }
private static void msg_SCID_SELF_DATA_END(int iMsgID, ref CMessage msg) { CliProto.SC_SELF_DATA_END refMSG = (CliProto.SC_SELF_DATA_END)msg; SDGlobal.Log("<- SCID_SELF_DATA_END : server finished init data sending!"); //notifyWantEnterScene(0); // 加载场景(非主线程中启动场景加载会有问题) //setLoadFlag(true); if (SDNetGlobal.bReConnectGate) { SDNetGlobal.SendEnterScene(); SDNetGlobal.SendCache(); return; } sdUICharacter.LoadScene(); }
public static bool init() { SDGlobal.Log("sdAwardCenterMsg.init"); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_DAY_NTF, msg_SC_GIFT_DAY_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_DAY_UPD, msg_SC_GIFT_DAY_UPDATE); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_DAY_BOX_NTF, msg_SC_GIFT_DAY_BOX_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_SIGN_NTF, msg_SC_GIFT_SIGN_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_SIGN_VIP_NTF, msg_SC_GIFT_SIGN_VIP_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_LEVEL_NTF, msg_SC_GIFT_LEVEL_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_JIHUOMA_ACK, msg_SC_GIFT_JIHUOMA_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_EP_INFO_ACK, msg_SC_GIFT_EP_INFO_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GIFT_RECEIVE_EP_ACK, msg_SC_GIFT_RECEIVE_EP_ACK); return(true); }
public static bool init() { SDGlobal.Log("sdMailMsg.init"); //邮件列表通知.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_MAIL_LIST_NTF, msg_SC_MAIL_LIST_NTF); //发送邮件ack.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SEND_MAIL_ACK, msg_SC_SEND_MAIL_ACK); //读邮件ack.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_READ_MAIL_ACK, msg_SC_READ_MAIL_ACK); //删除邮件ack.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_DELETE_MAIL_ACK, msg_SC_DELETE_MAIL_ACK); //更新邮件通知.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_UPDATE_MAIL_NTF, msg_SC_UPDATE_MAIL_NTF); return(true); }
private static void msg_SCID_SELF_LOADSCENE(int iMsgID, ref CMessage msg) { CliProto.SC_SELF_LOADSCENE refMSG = (CliProto.SC_SELF_LOADSCENE)msg; if (SDNetGlobal.bReConnectGate) { Debug.Log("Scene Type " + refMSG.m_SceneType); return; } SDGlobal.Log("<- SCID_SELF_LOADSCENE : server finished scene create and load, notify client " + "start to load scene and server start to send init data to client!"); sdGlobalDatabase.Instance.globalData["SceneId"] = (uint)refMSG.m_SceneId; sdGlobalDatabase.Instance.globalData["SceneType"] = (uint)refMSG.m_SceneType; SDNetGlobal.bHeartBeat = true; }
// protected void OnMessage_GCID_ROLELIST(int iMsgID, ref CMessage msg) { SDGlobal.Log("rolelist received"); CliProto.GC_ROLELIST refMSG = (CliProto.GC_ROLELIST)msg; SDNetGlobal.roleCount = refMSG.m_Count; SDNetGlobal.lastSelectRole = SelectRole.SortRoleList(refMSG); for (int i = 0; i < SDNetGlobal.roleCount; i++) { if (SDNetGlobal.playerList[i] == null) { SDNetGlobal.playerList[i] = new sdPlayerInfo(); } sdPlayerInfo kPlayerInfo = SDNetGlobal.playerList[i]; kPlayerInfo.mRoleName = System.Text.Encoding.UTF8.GetString(refMSG.m_RoleInfoList[i].m_RoleInfo.m_RoleName).Trim('\0'); kPlayerInfo.mDBID = refMSG.m_RoleInfoList[i].m_RoleInfo.m_DBRoleId; kPlayerInfo.mGender = refMSG.m_RoleInfoList[i].m_RoleInfo.m_Gender; kPlayerInfo.mSkinColor = refMSG.m_RoleInfoList[i].m_RoleInfo.m_SkinColor; kPlayerInfo.mHairStyle = refMSG.m_RoleInfoList[i].m_RoleInfo.m_HairStyle; kPlayerInfo.mBaseJob = refMSG.m_RoleInfoList[i].m_RoleInfo.m_BaseJob; kPlayerInfo.mJob = refMSG.m_RoleInfoList[i].m_RoleInfo.m_Job; kPlayerInfo.mLevel = refMSG.m_RoleInfoList[i].m_RoleInfo.m_Level; kPlayerInfo.mEquipCount = refMSG.m_RoleInfoList[i].m_Equip.m_ItemCount; if (kPlayerInfo.mEquipCount > 0) { kPlayerInfo.mEquipID = new uint[kPlayerInfo.mEquipCount]; for (int j = 0; j < kPlayerInfo.mEquipCount; ++j) { kPlayerInfo.mEquipID[j] = (uint)refMSG.m_RoleInfoList[i].m_Equip.m_Items[j].m_TID; } } } for (int i = SDNetGlobal.roleCount; i < 4; i++) { SDNetGlobal.playerList[i] = null; } m_bRoleListRec = true; }
// protected void OnMessage_GCID_CREATEROLE(int iMsgID, ref CMessage msg) { SDGlobal.Log("create role received"); CliProto.GC_CREATEROLE netMsg = (CliProto.GC_CREATEROLE)msg; if (netMsg.m_ErrCode != 0) { if (netMsg.m_ErrCode == 8104) { sdUICharacter.Instance.ShowOkMsg("角色名有非法字符!", null); } else { sdUICharacter.Instance.ShowOkMsg(SGDP.ErrorString((uint)netMsg.m_ErrCode), null); } } m_bCreateRec = true; }
public static void OnMessage_GCID_ROLELIST(int iMsgID, ref CMessage msg) { Debug.Log("OnMessage_GCID_ROLELIST"); if (sdGameLevel.instance.levelType != sdGameLevel.LevelType.SelectRole) { CliProto.CG_SELECTROLE refMSG = new CliProto.CG_SELECTROLE(); refMSG.m_RoleDBID = SDNetGlobal.playerList[SDNetGlobal.lastSelectRole].mDBID; if (client != null) { client.Send(refMSG); } SDGlobal.Log("Send CG_SELECTROLE"); } else { SendCache(); } }
private static void msg_SCID_SKILL_INFO_NTF(int iMsgID, ref CMessage msg) { CliProto.SC_SKILL_INFO_NTF refMSG = (CliProto.SC_SKILL_INFO_NTF)msg; SDGlobal.Log("<- SCID_SKILL_INFO_NTF : "); sdGameSkillMgr.Instance.CreateSkill((int)refMSG.m_Info.m_SkillID, (int)refMSG.m_Info.m_CooldownTime); sdGameSkillMgr.Instance.newSkill = (int)refMSG.m_Info.m_SkillID; sdNewInfoMgr.Instance.CreateNewInfo(NewInfoType.Type_Skill); GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdSkillWnd skill = wnd.GetComponentInChildren <sdSkillWnd>(); if (skill != null) { skill.Refresh(); } } sdUICharacter.Instance.TipNextSkill(); }
public static bool init() { SDGlobal.Log("sdItemMsg.init"); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_BAG_NTF, msg_SCID_ROLE_BAG_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_EQUIP_NTF, msg_SCID_ROLE_EQUIP_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_BAG_SINGLE_LEAVE_NTF, msg_SCID_ROLE_BAG_SINGLE_LEAVE_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_BAG_SINGLE_ENTER_NTF, msg_SCID_ROLE_BAG_SINGLE_ENTER_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_EQUIP_SINGLE_LEAVE_NTF, msg_SCID_ROLE_EQUIP_SINGLE_LEAVE_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_EQUIP_SINGLE_ENTER_NTF, msg_SCID_ROLE_EQUIP_SINGLE_ENTER_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_ITEMUP_ACK, msg_SCID_ROLE_ITEMUP_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_SUIT_NTF, msg_SCID_ROLE_SUIT_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_HOLE_ON_ACK, msg_SCID_ROLE_HOLE_ON_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_HOLE_OFF_ACK, msg_SCID_ROLE_HOLE_OFF_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_HOLE_REFRESH_ACK, msg_SCID_ROLE_HOLE_REFRESH_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_HOLE_MERGE2_ACK, msg_SCID_ROLE_HOLE_MERGE_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_LIMIT_NTF, msg_SCID_ROLE_LIMIT_NTF); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_PROD_ACK, msg_SCID_ROLE_PROD_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_USEITEM_START_ACK, msg_SCID_ROLE_USEITEM_START_ACK); SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_ROLE_USEITEM_END_ACK, msg_SCID_ROLE_USEITEM_END_ACK); return(true); }
public static bool init() { SDGlobal.Log("sdPetMsg.init"); //角色拥有过得宠物模板ID列表.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PETS_RECORD_NTF, msg_SC_PETS_RECORD_NTF); //角色宠物列表.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_USER_PETS_NTF, msg_SCID_USER_PETS_NTF); //宠物属性更新.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_SINGLE_ENTER_NTF, msg_SCID_SINGLE_ENTER_NTF); //宠物属性更新.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_SINGLE_LEAVE_NTF, msg_SCID_PET_SINGLE_LEAVE_NTF); //宠物吃宠物ack.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_GET_EXP_ACK, msg_SC_PET_GET_EXP_ACK); //宠物升级.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_LEVEL_NTF, msg_SCID_PET_LEVEL_NTF); //宠物强化.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_UP_ACK, msg_SCID_PET_UP_ACK); //通知宠物出战.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_SET_BATTLE_PET_NTF, msg_SCID_SET_BATTLE_PET_NTF); //通知战队切换.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_TEAM_NTF, msg_SC_PET_TEAM_NTF); //获得新宠物.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_ADD_NTF, msg_SC_PET_ADD_NTF); //宠物装备列表.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_BAG_NTF, msg_SC_PET_BAG_NTF); //宠物装备单件失去.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_BAG_SINGLE_LEAVE_NTF, msg_SC_PET_BAG_SINGLE_LEAVE_NTF); //宠物装备单件得到或更新.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_PET_BAG_SINGLE_ENTER_NTF, msg_SC_PET_BAG_SINGLE_ENTER_NTF); //物品碎片列表.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GATHER_INFO_NTF, msg_SC_GATHER_INFO_NTF); //更新单个碎片信息.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GATHER_SINGLE_ENTER_NTF, msg_SC_GATHER_SINGLE_ENTER_NTF); //消耗单个碎片.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GATHER_SINGLE_LEAVE_NTF, msg_SC_GATHER_SINGLE_LEAVE_NTF); //碎片合成的回应.. SDNetGlobal.setCallBackFunc((ushort)CliProto.EN_CliProto_MessageID.SCID_GATHER_ITEM_MERGE_ACK, msg_SC_GATHER_ITEM_MERGE_ACK); return(true); }
//宠物物品单件得到或者更新属性.. private static void msg_SC_PET_BAG_SINGLE_ENTER_NTF(int iMsgID, ref CMessage msg) { CliProto.SC_PET_BAG_SINGLE_ENTER_NTF refMsg = (CliProto.SC_PET_BAG_SINGLE_ENTER_NTF)msg; SDGlobal.Log("<- SCID_PET_BAG_SINGLE_ENTER_NTF : "); sdNewPetMgr.Instance.addOrUpdatePetItem(refMsg.m_Item.m_TID, refMsg.m_Item.m_UID, refMsg.m_Item.m_CT); GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIPetEquipPnl petEquipPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petEquipPnl) { petEquipPnl.RefreshPetItemListPage(); } sdUIPetChangeEquipPnl petEquipPnl2 = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>(); if (petEquipPnl2) { petEquipPnl2.RefreshPetItemListPage(); } } }