1
This commit is contained in:
@@ -2,14 +2,13 @@
|
||||
using Assets.MyGame.Scripts.Net.WebResponses.ChineseChess;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using Unity.VisualScripting;
|
||||
|
||||
public partial class WebSocketSendList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取房间信息
|
||||
/// </summary>
|
||||
/// <param name="leave"></param>
|
||||
/// <param name="sit"></param>
|
||||
public static void GetRoomListFish(int leave,int district)
|
||||
{
|
||||
WebSocketManager.Instance.Send(SocketType.room, "{\"type\":1,\"target\":\"GetRoomList\",\"invocationId\":\"1\",\"arguments\":[\"" + GameManager.Instance.user.id + "\"," + (int)GameManager.Instance.gameData.currGameType + "," + leave + ","+ district + "]}");
|
||||
@@ -54,12 +53,21 @@ public partial class WebSocketSendList
|
||||
/// <param name="roomId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="level">房间等级</param>
|
||||
public static void JoinRoom(string roomId, string userId, int level)
|
||||
public static void JoinRoom(string roomId, string userId, int sitID)
|
||||
{
|
||||
var sendObj = new WebSocketSendList("JoinRoom", roomId, userId, level);
|
||||
var sendObj = new WebSocketSendList("JoinRoom", roomId, userId, sitID);
|
||||
WebSocketManager.Instance.Send(SocketType.game, JsonConvert.SerializeObject(sendObj));
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取房间信息
|
||||
/// </summary>
|
||||
/// <param name="roomId">房间id</param>
|
||||
public static void GetRoomInfo(string roomId)
|
||||
{
|
||||
var sendObj = new WebSocketSendList("GetRoomInfo", roomId);
|
||||
WebSocketManager.Instance.Send(SocketType.room, JsonConvert.SerializeObject(sendObj));
|
||||
}
|
||||
/// <summary>
|
||||
/// 使用道具
|
||||
/// </summary>
|
||||
/// <param name="roomId"></param>
|
||||
@@ -92,4 +100,22 @@ public partial class WebSocketSendList
|
||||
var sendObj = new WebSocketSendList("ChangeGunMultiple", roomId, userId, multiple);
|
||||
WebSocketManager.Instance.Send(SocketType.game, JsonConvert.SerializeObject(sendObj));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据同步
|
||||
/// </summary>
|
||||
public static void SyncGameData(object obj)
|
||||
{
|
||||
WebSocketSendList sendObj = new WebSocketSendList
|
||||
{
|
||||
type = 1,
|
||||
invocationId = "1",
|
||||
target = "SyncGameData",
|
||||
arguments = new System.Collections.Generic.List<object>()
|
||||
};
|
||||
|
||||
sendObj.arguments.Add(GameManager.Instance.gameData.currRoomData.roomId);
|
||||
sendObj.arguments.Add(obj);
|
||||
WebSocketManager.Instance.Send(SocketType.game, JsonConvert.SerializeObject(sendObj));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user