Exemple #1
0
        private void hSockTcpEnterAck(MsgBody msg)
        {
            msg.Read(out int slot);
            msg.Read(out int seq);
            msg.Read(out string val2);
            msg.Read(out string val3);
            msg.Read(out int val4);
            msg.Read(out string val5);
            msg.Read(out int val6);
            msg.Read(out int val7);
            string[] array = new string[val7];
            for (int j = 0; j < val7; j++)
            {
                msg.Read(out array[j]);
            }
            msg.Read(out int val8);
            msg.Read(out int val9);
            msg.Read(out int val10);
            msg.Read(out string val11);
            msg.Read(out int val12);
            msg.Read(out int val13);
            msg.Read(out byte val14);
            msg.Read(out val7);
            string[] array2 = (val7 > 0) ? new string[val7] : null;
            for (int j = 0; j < val7; j++)
            {
                msg.Read(out array2[j]);
            }
            msg.Read(out val7);
            string[] array3 = (val7 > 0) ? new string[val7] : null;
            for (int k = 0; k < val7; k++)
            {
                msg.Read(out array3[k]);
            }
            BrickManManager.Instance.OnEnter(seq, val2, array, val8, val9, val10, val11, val12, val13, array2, array3);
            BrickManManager.Instance.GetDesc(seq).Slot = (sbyte)slot;
            if (seq != MyInfoManager.Instance.Seq)
            {
                P2PManager.Instance.Add(seq, val3, val4, val5, val6, val14);

                if (RoomManager.Instance.CurrentRoom >= 0)
                {
                    GameObject gameObject = GameObject.Find("Main");
                    if (null != gameObject)
                    {
                        gameObject.BroadcastMessage("OnChat", new ChatText(ChatText.CHAT_TYPE.SYSTEM, seq, val2, StringMgr.Instance.Get("ENTERED")));
                    }
                }
            }

            else
            {
                MyInfoManager.Instance.Slot = (sbyte)slot;
            }
        }
Exemple #2
0
        private void HandleReceiveSlotData(MsgBody msg)
        {
            msg.Read(out int count);
            for (int i = 0; i < count; i++)
            {
                msg.Read(out int slot);
                msg.Read(out int seq);
                msg.Read(out string name);
                msg.Read(out string ip);
                msg.Read(out int port);
                msg.Read(out string remoteIp);
                msg.Read(out int remotePort);
                msg.Read(out int equipCount);
                string[] equipment = new string[equipCount];
                for (int j = 0; j < equipCount; j++)
                {
                    msg.Read(out equipment[j]);
                }
                msg.Read(out int status);
                msg.Read(out int xp);
                msg.Read(out int clanSeq);
                msg.Read(out string clanName);
                msg.Read(out int clanMark);
                msg.Read(out int rank);
                msg.Read(out byte playerflag);
                msg.Read(out equipCount);
                string[] wpnChg = (equipCount > 0) ? new string[equipCount] : null;
                for (int j = 0; j < equipCount; j++)
                {
                    msg.Read(out wpnChg[j]);
                }
                msg.Read(out equipCount);
                string[] drpItem = (equipCount > 0) ? new string[equipCount] : null;
                for (int k = 0; k < equipCount; k++)
                {
                    msg.Read(out drpItem[k]);
                }

                if (seq != MyInfoManager.Instance.Seq)
                {
                    P2PManager.Instance.Add(seq, ip, port, remoteIp, remotePort, playerflag);
                    BrickManManager.Instance.OnEnter(seq, name, equipment, status, xp, clanSeq, clanName, clanMark, rank, equipment, equipment);
                    BrickManDesc desc = BrickManManager.Instance.GetDesc(seq);
                    desc.Slot = (sbyte)slot;
                }

                else
                {
                    MyInfoManager.Instance.Slot = (sbyte)slot;
                }
            }
        }