public virtual void OnSocketSubPrivateInfo(CMD_GR_Private_Info pNetInfo) { Loom.QueueOnMainThread(() => { m_kPrivateInfo = pNetInfo; if (m_eLinkAction == Type_LinkAction.Type_Link_Create) { var buf = StructConverterByteArray.StructToBytes(m_kCreatePrivateNet); CServerItem.get().SendSocketData(GameServerDefines.MDM_GR_PRIVATE, GameServerDefines.SUB_GR_CREATE_PRIVATE, buf, (ushort)buf.Length); //zeromemory(&m_kCreatePrivateNet, sizeof(m_kCreatePrivateNet)); m_kCreatePrivateNet = new CMD_GR_Create_Private(); } if (m_eLinkAction == Type_LinkAction.Type_Link_Join) { CMD_GR_Join_Private kSendNet; kSendNet.dwRoomNum = (uint)m_iJoinRoomId; //utility::parseInt(m_kJoinNumTxt); // lin Temp do this kSendNet.cbGameTypeIdex = m_cbGameTypeIdex; //WQ add kSendNet.cbChoosedModelIndex = (byte)PlayerPrefs.GetInt("ChoosedModelIndex"); Debug.Log("OnSocketSubPrivateInfo Type_Link_Join: m_cbGameTypeIdex=" + m_cbGameTypeIdex); var buf = StructConverterByteArray.StructToBytes(kSendNet); CServerItem.get().SendSocketData(GameServerDefines.MDM_GR_PRIVATE, GameServerDefines.SUB_GR_JOIN_PRIVATE, buf, (ushort)buf.Length); } m_eLinkAction = Type_LinkAction.Type_Link_NULL; }); }
void ConnectAndCreatePrivateByServerID(int iServerID, CMD_GR_Create_Private kNet) { GameManagerBaseNet.InstanceBase().connectGameServerByServerID(iServerID); m_kCreatePrivateNet = kNet; //memcpy(&m_kCreatePrivateNet,&kNet,sizeof(kNet)); m_eLinkAction = Type_LinkAction.Type_Link_Create; }
public void ConnectAndCreatePrivateByKindIDAndServerType(int iKindID, ushort wServerType, CMD_GR_Create_Private kNet) //WQ add { GameManagerBaseNet.InstanceBase().connectGameServerByKindIDAndServerType((ushort)iKindID, wServerType); //memcpy(&m_kCreatePrivateNet, &kNet, sizeof(kNet)); m_kCreatePrivateNet = kNet; m_eLinkAction = Type_LinkAction.Type_Link_Create; }
public HNPrivateScenceBase(HNGameManager ma) { m_iJoinCout = (0); m_eLinkAction = (Type_LinkAction.Type_Link_NULL); m_kCreatePrivateNet = new CMD_GR_Create_Private(); m_kPrivateInfo = new CMD_GR_Private_Info(); m_kPrivateRoomInfo = new CMD_GF_Private_Room_Info(); CServerItem.get().SetServerPrivateSink(this); hnManager = ma; }
//自由匹配 public void Button_JoinRace() { CMD_GR_Create_Private kSendNet = new CMD_GR_Create_Private(); kSendNet.stHttpChannel = new byte[SocketDefines.LEN_NICKNAME]; kSendNet.cbGameType = (byte)RoomType.Type_Public; kSendNet.bGameTypeIdex = GAME_TYPE_JianDe; //mChen kSendNet.bGameTypeIdex = GAME_TYPE_ZZ; kSendNet.cbPlayCostTypeIdex = 0; // hnManager.m_cbPlayCostTypeIdex; ;// 1000 * 0.05;//for金币房三种倍率 kSendNet.lBaseScore = 1; kSendNet.PlayerCount = HNMJ_Defines.GAME_PLAYER; kSendNet.bGameRuleIdex = 130; kSendNet.bPlayCoutIdex = 0;// hnManager.m_cbPlayCoutIdex; kSendNet.cbChoosedModelIndex = (byte)PlayerPrefs.GetInt("ChoosedModelIndex"); PlayerPrefs.SetInt("PubOrPrivate", (int)RoomType.Type_Public); PlayerPrefs.Save(); //mChen ConnectAndCreatePrivateByKindIDAndServerType(GameScene.KIND_ID_JianDe, SocketDefines.GAME_GENRE_EDUCATE, kSendNet); }