Files
hjha-server/GlobalSever/GlobalManager/SendManager.cs
xiaoou e9616125ce feat: initial commit - HJHA game server full source
6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) +
game logic (GameFix/GameDAL/ServerData) +
network layer (NetWorkMessage) +
data layer (ObjectModel) +
utilities (MrWu/Core/Config/CloudAPI/dll) +
adapters (zyxAdapter/base)

.NET 8.0 C# solution, 16 projects, 958 source files
2026-07-07 12:02:15 +08:00

164 lines
7.0 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using GameData;
using Server.MQ;
using MrWu.Debug;
namespace Server
{
/// <summary>
/// 发包管理
/// </summary>
public static class SendManager {
/// <summary>
/// 0.不启用
/// 1.服务器维护中,请稍后再试!
/// 2.请求超时!请稍后再试!
/// 3.服务器爆满!请稍后再试!
/// 4.房间号错误,无此房间!
/// 5.进入失败!密码错误!
/// 6.房间已开战,进入失败!
/// 7.房间已满员,进入失败!
/// 8.检测到相同ip账号进入失败!
/// 9.未获取到您的ip,进入失败!
/// 10.进入失败,必须微信登录或者微信绑定才能进入此房间!
/// 11.进入失败,必须是微信绑定的账号才能进入此房间!
/// 12.房卡不足创建失败!
/// 13.数据错误,请重新登录!
/// 14.登录过期,请重新登录!
/// 15.用户名或密码为空
/// 16.用户名或密码错误
/// 17.对方不在线
/// 18.您在朋友房中,不能重复创建!
/// 19.您已经在朋友房中了!
/// 20.朋友房规则错误!
/// 21.房卡不足创建失败!
/// 22.竞技比赛名称必须是3-8个字符串组成!
/// 23.竞技比赛名称非法!
/// 24.创建失败!请稍后再试!
/// 25.创建的竞技比赛已达上限!
/// 26.竞技比赛公告过长!
/// 27.竞技比赛公告包含特殊字符!
/// 28.竞技比赛名称已被使用!
/// 29.数据错误!
/// 30.您不在此竞技比赛!
/// 31.您的权限不足!
/// 32.修改失败,公告过长或有特殊字符!
/// 33.房卡不足,创建失败!
/// 34.充值失败!
/// 35.由于管理员设置,您无法加入该游戏!
/// 36.房卡不足加入失败!
/// 37.未知错误,服务器报错!!!
/// 38.竞技比赛房间,无法手动加入!",
/// 39.操作失败,您在游戏中无法进行仓库操作!,
/// 40.仓库密码错误
/// 41.您在游戏中无法进行存取金币操作
/// 42.金币操作数额过大。
/// 43.您身上的金币不足,取出失败
/// 44.您身上的游戏币超过限额,无法取出!
/// 45.您身上的游戏币不足,存入失败
/// 46.您的金币不足,赠送失败!
/// 47.操作失败,请稍后重新发起!
/// 48.赠送的金币必须大于1
/// 49.金币不足,购买失败!
/// 50.操作失败,请稍后再试!
/// 51.卖出失败!
/// 52.不能卖出身上的物品!
/// 53.保存失败!
/// 54.玩法已被修改或者删除!
/// 55.防作弊检查,进入房间失败!
/// 56.创建失败,未检测到ip地址!
/// 57.暂时微信用户才可创建房间,绑定后再试!
/// 58.防作弊房间需开启定位才可创建!
/// 59.未获取到设备信息,请稍后再试!
/// 60.超时未准备,您已被踢出房间!
/// 61.您在别处登录游戏!
/// 62.等级不满6级不能使用该功能!
/// 63.密码修改失败!
/// 64.旧密码错误!
/// 65.验证码不正确!
/// 66.参数不正确,必须包含联系方式、登录名、登录密码及预留的联系信息!
/// 67.新密码格式不对!
/// 68.房卡不足,充值失败!
/// 69.没有这个玩家,赠送失败!
/// 70."没有这个用户,请检查手机号是否输入正确!"
/// 71."没有这个用户,请检查用户名是否正确!",
/// 72."该用户未绑定手机,请联系客服修改密码!"
/// 73."加入失败!"
/// 74."不存在这个房间!"
/// 75."解散成功!"
/// 76."已存在相同名称的战队!"
/// 77."金币不足,创建战队失败!"
/// 78.""不存在该战队!"
/// 79."超时未准备,您已被踢出房间!"
/// </summary>
/// <param name="head"></param>
/// <param name="style"></param>
/// <param name="tiptext"></param>
public static void SendErrotInfo_Http(PackHead head, int style, int tiptext) {
head.transfer = GamePackAgreement.pack_error;
head.packlx = GamePackAgreement.TransFerHttp;
TipInfo errPack = new TipInfo(style, tiptext);
ServerNode node = head.Util;
GlobalMQ.instance.DeliveryOne(node, GlobalMQ.CreateMessage(head, errPack), true);
}
/// <summary>
/// 发送游戏币超上限提示
/// </summary>
/// <param name="userid"></param>
/// <param name="node"></param>
public static void SendMoneyUpper(int userid, ServerNode node) {
PackHead head = new PackHead();
head.userid = userid;
head.packlx = GamePackAgreement.TransFerPack;
head.transfer = GamePackAgreement.MoneyUpper;
GlobalMQ.instance.DeliveryOne(node, GlobalMQ.CreateMessage(head), true);
}
/// <summary>
/// 发送自定义错误提示信息
/// </summary>
/// <param name="head"></param>
/// <param name="style"></param>
/// <param name="tiptext"></param>
public static void SendErrotInfo_Http(PackHead head, int style, string tiptext) {
head.transfer = GamePackAgreement.autoTipInfo;
head.packlx = GamePackAgreement.TransFerHttp;
head.otherString = new string[] { tiptext };
ServerNode node = head.Util;
GlobalMQ.instance.DeliveryOne(node, GlobalMQ.CreateMessage(head, null), true);
}
/// <summary>
/// 发送一个在游戏中的包给客服端
/// </summary>
/// <param name="userid">userid</param>
/// <param name="game_serid">游戏服务器id</param>
/// <param name="clickgame_serid">点击的游戏服务器id</param>
/// <param name="friendRoom">朋友房房号</param>
/// <param name="style">类型 1.提示进入 2.让客户端立即进入</param>
/// <param name="head">SocketNode Socket节点</param>
public static void SendInGameInfo_Http(int userid, int game_serid, int clickgame_serid, int friendRoom, int style, PackHead head) {
if (head == null) {
Debug.Warning("SendInGameInfo_Http params error head is null");
return;
}
PlayerGameInfo pgi = new PlayerGameInfo(game_serid, friendRoom,style, clickgame_serid);
head.packlx = GamePackAgreement.TransFerHttp;
head.transfer = GamePackAgreement.InGameInfo;
head.userid = userid;
GlobalMQ.instance.DeliveryOne(head.Util, GlobalMQ.CreateMessage(head, pgi), true);
}
}
}