383 lines
8.9 KiB
C#
383 lines
8.9 KiB
C#
using System;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
public class Global : MonoBehaviour
|
||
{
|
||
|
||
public logoPanel.ServerResponse serverResponse;
|
||
public ServerResponse response;
|
||
public static Global global ;
|
||
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
global = this;
|
||
DontDestroyOnLoad(this);
|
||
}
|
||
|
||
// 创建请求头,使用最新的 token
|
||
public Dictionary<string, string> CreateHeaders()
|
||
{
|
||
|
||
|
||
if (string.IsNullOrEmpty(Global.global.serverResponse.data.token))
|
||
{
|
||
Debug.LogWarning("尝试创建请求头时,token 未设置。");
|
||
return new Dictionary<string, string>();
|
||
}
|
||
|
||
return new Dictionary<string, string>
|
||
{
|
||
{ "Authorization", Global.global.serverResponse.data.token }
|
||
};
|
||
}
|
||
}
|
||
[Serializable]
|
||
public class GameEscapeRoomResponseVo
|
||
{
|
||
public int escapeId; // 游戏的ID
|
||
public int roomNo; // 房间编号
|
||
public float roomBeansCoin; // 房间下注欢乐豆
|
||
public int roomUserNo;
|
||
}
|
||
[Serializable]
|
||
public class userIDgameId
|
||
{
|
||
public int userId; // 用户id
|
||
public int escapeId; // 游戏id
|
||
public int orderByDesc;//参与记录正序或倒叙,1正序,其他倒叙
|
||
public int weekType;//1是昨天,0是今天
|
||
}
|
||
|
||
|
||
[Serializable]
|
||
public class Data
|
||
{
|
||
public int carrySeconds; // 携带时间秒数
|
||
public List<GameEscapeRoomResponseVo> gameEscapeRoomResponseVoList; // 房间列表
|
||
public GameEscapeModel gameEscapeModel; // 游戏逃亡模型 (目前未处理)
|
||
public object gameEscapeUserModel; // 游戏逃亡用户模型 (目前未处理)
|
||
}
|
||
|
||
|
||
[Serializable]
|
||
public class Data514
|
||
{
|
||
public int id;
|
||
public string gameNo;
|
||
public int demonMode;
|
||
public string startTime;
|
||
public string betTime;
|
||
public string countTime;
|
||
public string settleTime;
|
||
public int status;
|
||
public string roomNoKill;
|
||
public string roomNoRemain;
|
||
public float beansCoinAll;
|
||
public float beansCoinKill;
|
||
public float beansCoinRemain;
|
||
public float beansCoinFee;
|
||
public float beansCoinRank;
|
||
public float beansCoinDivide;
|
||
}
|
||
|
||
[Serializable]
|
||
public class Data515
|
||
{
|
||
public float bet;//当前用户的下注
|
||
public int roomNo;//当前用户下注的房间号
|
||
public int outcome;//默认0还没结果,1胜利,2失败
|
||
public float win;//获胜后赢得多少欢乐豆
|
||
public float beansCoin;//本局最终获得多少欢乐豆
|
||
public float ichorCoin;//本局最终获得的灵液
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class ServerResponse515 : Response
|
||
{
|
||
public Data515 data; // 数据对象
|
||
}
|
||
|
||
|
||
[Serializable]
|
||
public class ServerResponse: Response
|
||
{
|
||
public Data data; // 数据对象
|
||
}
|
||
[Serializable]
|
||
public class ServerResponse514: Response
|
||
{
|
||
public Data514 data; // 数据对象
|
||
}
|
||
|
||
public class Response
|
||
{
|
||
public int code; // 响应状态码
|
||
public string message; // 提示语
|
||
}
|
||
// 数据类
|
||
[Serializable]
|
||
public class GameEscapeModel
|
||
{
|
||
public int id; // 游戏 ID
|
||
public string gameNo; // 游戏编号
|
||
public int demonMode; // 恶魔模式
|
||
public string startTime; // 开始时间
|
||
public string betTime; // 下注时间
|
||
public string countTime; // 结算时间
|
||
public string settleTime; // 最终结算时间
|
||
public int status; // 游戏状态
|
||
public string roomNoKill; // 无杀房间号
|
||
public string roomNoRemain; // 剩余房间号
|
||
public float beansCoinAll; // 总豆币数
|
||
public float beansCoinKill; // 击杀豆币数
|
||
public float beansCoinRemain; // 剩余豆币数
|
||
public float beansCoinFee; // 手续费
|
||
public float beansCoinRank; // 排名奖励豆币
|
||
public float beansCoinDivide; // 分成豆币
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class ServerResponse513 : Response
|
||
{
|
||
public int code; // 数据对象
|
||
public string mesage;
|
||
}
|
||
|
||
|
||
|
||
//玩家信息
|
||
[Serializable]
|
||
public class UserInfomation14: Response
|
||
{
|
||
public UserInfomation14Data data;
|
||
}
|
||
[Serializable]
|
||
public class UserInfomation14Data
|
||
{
|
||
public int userId;//id
|
||
public long userName;//用户名(电话)
|
||
public string token;
|
||
public string nickName;//昵称
|
||
public string headImg;//头像
|
||
public int gender;//性别,1男2女
|
||
public string birthday;//出生,"yyyy-MM-dd HH:mm:ss"
|
||
public float voluteCoin;//蜗壳
|
||
public float beansCoin;//蜗蛋
|
||
public float ichorCoin;//灵液
|
||
public string idCard;//=========================
|
||
public string inviteCodeMy;//=============
|
||
public string inviteCodeBind;//==========
|
||
public string bindTime;//===========
|
||
public int station;//=========
|
||
public string cuteNo;//靓号
|
||
public string menberTime;//===============
|
||
public bool isMember;
|
||
//public int cuteNo;//靓号
|
||
}
|
||
|
||
[Serializable]
|
||
public class ServerResponse516 : Response
|
||
{
|
||
public Data516 data; // 数据对象
|
||
}
|
||
|
||
[Serializable]
|
||
public class Data516
|
||
{
|
||
public List<gameEscapeRoomKillCountResponseVo> gameEscapeRoomKillCountResponseVoList;
|
||
public List<gameEscapeModel> gameEscapeModelList;
|
||
}
|
||
|
||
[Serializable]
|
||
public class gameEscapeRoomKillCountResponseVo
|
||
{
|
||
public int roomNo;//房间号
|
||
public int kill;//击杀次数
|
||
|
||
}
|
||
|
||
|
||
[Serializable]
|
||
public class gameEscapeModel
|
||
{
|
||
public string gameNo;//游戏编号
|
||
public string roomNoKill;//击杀的房间 "5,6,7,8"这种
|
||
|
||
}
|
||
|
||
|
||
|
||
[Serializable]
|
||
public class ServerResponse517 : Response
|
||
{
|
||
public Data517 data; // 数据对象
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class Data517
|
||
{
|
||
public float beansCoinBet;//当前用户总投入的欢乐豆
|
||
public float beansCoinWin;//当前用户总赚取的欢乐豆
|
||
public gameEscapeUserRecordResponseVoPageResult gameEscapeUserRecordResponseVoPageResult; //用户参与的大逃亡分页
|
||
|
||
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class gameEscapeUserRecordResponseVoPageResult
|
||
{
|
||
|
||
public List<dataList> dataList;
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class dataList
|
||
{
|
||
|
||
public string gameNo;//游戏编号
|
||
public float bet;//下注欢乐豆
|
||
public int roomNo;//下注房间号
|
||
public string roomNoKill;//击杀房间号
|
||
public int outcome;//本局结果:默认0还未结束,1胜利,2失败
|
||
public float beansCoin;//本局最终获得欢乐豆
|
||
public string createTime;//创建时间
|
||
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class ServerResponse518 : Response
|
||
{
|
||
public Data518 data; // 数据对象
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class Data518
|
||
{
|
||
public List<gameEscapeUserBetResponseVoList> gameEscapeUserBetResponseVoLists;
|
||
public userBetInfo userBetInfo;
|
||
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class gameEscapeUserBetResponseVoList
|
||
{
|
||
|
||
public string userId;//用户id
|
||
public string nickName;// 昵称
|
||
public string headImg;// 头像
|
||
public float bet;// 下注总额
|
||
public int orderNo;// 排名
|
||
public float rankBonus;// 排名奖金
|
||
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class userBetInfo
|
||
{
|
||
public string userId;//用户id
|
||
public string nickName;// 昵称
|
||
public string headImg;// 头像
|
||
public float bet;// 下注总额
|
||
public int orderNo;// 排名
|
||
public float rankBonus;// 排名奖金
|
||
|
||
|
||
|
||
}
|
||
|
||
[Serializable]
|
||
public class Body518
|
||
{
|
||
public int userId; // 用户id
|
||
|
||
public int weekType;//1是昨天,0是今天
|
||
|
||
|
||
}
|
||
|
||
//==================================================================================
|
||
|
||
//工会分页
|
||
public class UnionPageBody//请求体
|
||
{
|
||
public int orderByDesc { get; set; }
|
||
}
|
||
|
||
public class UnionDataInPage
|
||
{
|
||
public int Id { get; set; }
|
||
public string Name { get; set; }
|
||
public string Cover { get; set; }
|
||
public int Level { get; set; }
|
||
public string Slogan { get; set; }
|
||
public int LeaderId { get; set; }
|
||
public string LeaderUserName { get; set; }
|
||
public string CreateTime { get; set; } // 由于createTime可能为null,且类型未明确,这里使用object类型,可根据实际情况调整为DateTime?或其他类型
|
||
public string UpdateTime { get; set; }
|
||
}
|
||
|
||
public class UnionPageData
|
||
{
|
||
public int PageNo { get; set; }
|
||
public int PageSize { get; set; }
|
||
public int TotalCount { get; set; }
|
||
public List<UnionDataInPage> DataList { get; set; }
|
||
}
|
||
|
||
public class UnionPage : Response
|
||
{
|
||
public UnionPageData Data { get; set; }
|
||
}
|
||
|
||
//========1.7================================================================
|
||
|
||
public class BizUnionModel
|
||
{
|
||
|
||
public int Id { get; set; }
|
||
public string Name { get; set; }
|
||
public string Cover { get; set; }
|
||
public int Level { get; set; }
|
||
public string Slogan { get; set; }
|
||
public int LeaderId { get; set; }
|
||
public string LeaderUserName { get; set; }
|
||
public string CreateTime { get; set; } // 可以根据实际情况调整为DateTime?
|
||
public string UpdateTime { get; set; }
|
||
}
|
||
|
||
public class BizUnionUserModel
|
||
{
|
||
public int Id { get; set; }
|
||
public int UnionId { get; set; }
|
||
public int UserId { get; set; }
|
||
public string UserName { get; set; }
|
||
public int Station { get; set; }
|
||
public int HigherUserId { get; set; }
|
||
public int HigherStation { get; set; }
|
||
public int Status { get; set; }
|
||
public string CreateTime { get; set; }
|
||
public string UpdateTime { get; set; }
|
||
}
|
||
|
||
public class UnionDetalResponseData
|
||
{
|
||
public BizUnionModel BizUnionModel { get; set; }
|
||
public List<BizUnionUserModel> BizUnionUserModelList { get; set; }
|
||
}
|
||
|
||
public class UnionDetalResponse : Response
|
||
{
|
||
public UnionDetalResponseData Data { get; set; }
|
||
} |