示例#1
0
        public static void SendToSocketServer(int index, System.Object msg)
        {
            if (clients == null)
            {
                return;
            }
            if (index < 0 || index >= clients.Length)
            {
                Debugger.LogError("send client index is invalid->" + index + "^" + clients.Length);
                return;
            }
            NetClient netClient = clients[index];

            if (netClient != null && netClient.IsSocketOK())
            {
                netClient.SendToSocketServer(msg);
            }
            else
            {
                Debugger.LogError("net client is not available->" + index);
            }
        }
示例#2
0
        public static void ScriptSendToSocketServer(int index, int tid, int gid, int uid, byte[] body)
        {
            if (clients == null)
            {
                return;
            }
            if (index < 0 || index >= clients.Length)
            {
                Debugger.LogError("script send client index is invalid->" + index + clients.Length);
                return;
            }
            NetClient netClient = clients[index];

            if (netClient != null && netClient.IsSocketOK())
            {
                netClient.SendToSocketServer((byte)tid, (byte)gid, (byte)uid, body);
            }
            else
            {
                Debugger.LogError("net client is not available->" + index);
            }
        }