-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
32,921 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<configuration> | ||
<appSettings> | ||
<!--基本配置 | ||
Port:监听端口 | ||
Code:产品代码 | ||
ServerId:产品游服代码 | ||
Redis.Host:Redis主机地址 | ||
Redis.Port:Redis主机端口 | ||
Redis.Password:密码 | ||
Redis.Db:数据库位置 | ||
--> | ||
<add key="Product.Code" value="0"/> | ||
<add key="Product.ServerId" value="0"/> | ||
<add key="Game.Port" value="9001"/> | ||
<add key="Redis.Host" value="127.0.0.1:6379"/> | ||
<add key="ScriptRelativePath" value="Script"/> | ||
<add key="CSharpRootPath" value="CsScript"/> | ||
<add key="LuaRootPath" value="LuaScript"/> | ||
<add key="Game.Language.TypeName" value="GameServer.CsScript.Locale.SimplifiedLanguage"/> | ||
<add key="Game.Action.Script.TypeName" value="GameServer.CsScript.Action.Action{0}"/> | ||
<add key="Script_IsDebug" value="True"/> | ||
<add key="Lua_Disable" value="True"/> | ||
|
||
<!--脚本解密回调配置--> | ||
<!--<add key="Game.Script.DecodeFunc.TypeName" value="ScutSecurity.ScriptDes,ScutSecurity"/>--> | ||
</appSettings> | ||
<connectionStrings> | ||
<!--<add name="SnsCenter" providerName="SqlDataProvider" connectionString="Data Source=localhost;Database=snscenter;Uid=sa;Pwd=123;Pooling=true;"/> | ||
<add name="PayCenter" providerName="SqlDataProvider" connectionString="Data Source=localhost;Database=PayDB;Uid=sa;Pwd=123;Pooling=true;"/> | ||
<add name="ConnData" providerName="SqlDataProvider" connectionString="Data Source=localhost;Database=PHData;Uid=game_user;Pwd=123;"/>--> | ||
</connectionStrings> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
|
||
xcopy /y ..\Lib\*.dll .\ | ||
|
||
ECHO Install Ok & PAUSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- | ||
This file needs to be put in the application directory. Make sure to set | ||
'Copy to Output Directory' option in Visual Studio. | ||
--> | ||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true"> | ||
<variable name="logDirectory" value="Log"/> | ||
<targets> | ||
<target name="Info" xsi:type="File" fileName="${logDirectory}/Info/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="Debug" xsi:type="File" fileName="${logDirectory}/Debug/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="Exception" xsi:type="File" fileName="${logDirectory}/Exception/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="Fatal" xsi:type="File" fileName="${logDirectory}/Fatal/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="Warn" xsi:type="File" fileName="${logDirectory}/Warn/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="Client" xsi:type="File" fileName="${logDirectory}/Client/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="SqlError" xsi:type="File" fileName="${logDirectory}/Sql/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="Complement" xsi:type="File" fileName="${logDirectory}/Complement/${date:format=yyyyMMddHH}.txt" layout="${message}"/> | ||
<target name="Console" xsi:type="Console" layout="${message}"/> | ||
</targets> | ||
<rules> | ||
<logger name="*" level="Info" writeTo="Info,Console"/> | ||
<logger name="*" level="Debug" writeTo="Debug"/> | ||
<logger name="*" level="Error" writeTo="Exception,Console"/> | ||
<logger name="*" level="Fatal" writeTo="Fatal"/> | ||
<logger name="*" level="Warn" writeTo="Warn"/> | ||
<logger name="Client" level="Trace" writeTo="Client"/> | ||
<logger name="Sql" level="Trace" writeTo="SqlError"/> | ||
<logger name="Complement" level="Trace" writeTo="Complement"/> | ||
</rules> | ||
</nlog> |
81 changes: 81 additions & 0 deletions
81
Release/6.7.9.7/Console/Script/CsScript/Action/Action1000.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2013-2015 scutgame.com | ||
http://www.scutgame.com | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
|
||
using GameServer.Model; | ||
using ZyGames.Framework.Cache.Generic; | ||
using ZyGames.Framework.Game.Contract; | ||
using ZyGames.Framework.Game.Service; | ||
|
||
namespace GameServer.CsScript.Action | ||
{ | ||
public class Action1000 : BaseStruct | ||
{ | ||
private string UserName; | ||
private int Score; | ||
|
||
|
||
public Action1000(HttpGet httpGet) | ||
: base(1000, httpGet) | ||
{ | ||
} | ||
|
||
public override void BuildPacket() | ||
{ | ||
|
||
} | ||
|
||
public override bool GetUrlElement() | ||
{ | ||
if (httpGet.GetString("UserName", ref UserName) | ||
&& httpGet.GetInt("Score", ref Score)) | ||
{ | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
public override bool TakeAction() | ||
{ | ||
var cache = new ShareCacheStruct<UserRanking>(); | ||
var ranking = cache.Find(m => m.UserName == UserName); | ||
if (ranking == null) | ||
{ | ||
var user = new GameUser() { UserId = (int)cache.GetNextNo(), NickName = UserName}; | ||
new PersonalCacheStruct<GameUser>().Add(user); | ||
ranking = new UserRanking(); | ||
ranking.UserID = user.UserId; | ||
ranking.UserName = UserName; | ||
ranking.Score = Score; | ||
cache.Add(ranking); | ||
} | ||
else | ||
{ | ||
ranking.UserName = UserName; | ||
ranking.Score = Score; | ||
} | ||
return true; | ||
} | ||
|
||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
Release/6.7.9.7/Console/Script/CsScript/Action/Action1001.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2013-2015 scutgame.com | ||
http://www.scutgame.com | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
using System; | ||
using System.Collections.Generic; | ||
using GameServer.Model; | ||
using ZyGames.Framework.Cache.Generic; | ||
using ZyGames.Framework.Common; | ||
using ZyGames.Framework.Game.Contract; | ||
using ZyGames.Framework.Game.Service; | ||
|
||
namespace GameServer.CsScript.Action | ||
{ | ||
public class Action1001 : BaseStruct | ||
{ | ||
private int PageIndex; | ||
private int PageSize; | ||
private int PageCount; | ||
private List<UserRanking> rankingList; | ||
|
||
|
||
public Action1001(HttpGet httpGet) | ||
: base(1001, httpGet) | ||
{ | ||
|
||
} | ||
|
||
public override void BuildPacket() | ||
{ | ||
this.PushIntoStack(PageCount); | ||
this.PushIntoStack(rankingList.Count); | ||
foreach (var item in rankingList) | ||
{ | ||
DataStruct dsItem = new DataStruct(); | ||
dsItem.PushIntoStack(item.UserName); | ||
dsItem.PushIntoStack(item.Score); | ||
//Console.WriteLine("Num count:{0}", item.Items.Count); | ||
this.PushIntoStack(dsItem); | ||
} | ||
|
||
} | ||
|
||
public override bool GetUrlElement() | ||
{ | ||
if (httpGet.GetInt("PageIndex", ref PageIndex) | ||
&& httpGet.GetInt("PageSize", ref PageSize)) | ||
{ | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
public override bool TakeAction() | ||
{ | ||
var cache = new ShareCacheStruct<UserRanking>(); | ||
rankingList = cache.FindAll(false); | ||
rankingList = MathUtils.QuickSort<UserRanking>(rankingList, compareTo); | ||
rankingList = rankingList.GetPaging(PageIndex, PageSize, out PageCount); | ||
return true; | ||
} | ||
|
||
private int compareTo(UserRanking x, UserRanking y) | ||
{ | ||
int result = y.Score - x.Score; | ||
if (result == 0) | ||
{ | ||
result = y.UserID - x.UserID; | ||
} | ||
return result; | ||
} | ||
} | ||
} |
106 changes: 106 additions & 0 deletions
106
Release/6.7.9.7/Console/Script/CsScript/Locale/SimplifiedLanguage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/**************************************************************************** | ||
Copyright (c) 2013-2015 scutgame.com | ||
http://www.scutgame.com | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
****************************************************************************/ | ||
using ZyGames.Framework.Game.Lang; | ||
|
||
namespace GameServer.CsScript.Locale | ||
{ | ||
public class SimplifiedLanguage : Language | ||
{ | ||
/// <summary> | ||
/// Sign error | ||
/// </summary> | ||
public new string SignError = "验证签名出错"; | ||
|
||
/// <summary> | ||
/// validate error | ||
/// </summary> | ||
public new string ValidateError = "请求的参数无效"; | ||
/// <summary> | ||
/// The system is busy | ||
/// </summary> | ||
public new string ServerBusy = "服务器繁忙"; | ||
|
||
/// <summary> | ||
/// param error | ||
/// </summary> | ||
public new string UrlElement = "缺少请求参数-"; | ||
|
||
/// <summary> | ||
/// 参数名:{0}不存在 | ||
/// </summary> | ||
public new string UrlNoParam = "参数名:{0}是必须的"; | ||
/// <summary> | ||
/// 参数名:{0}超出范围[{1}-{2}] | ||
/// </summary> | ||
public new string UrlParamOutRange = "参数:{0}超出范围[{1} - {2}]"; | ||
|
||
/// <summary> | ||
/// 服务器正在维护 | ||
/// </summary> | ||
public new string ServerMaintain = "服务器正在维护"; | ||
|
||
/// <summary> | ||
/// 服务器正在重启中,请稍候... | ||
/// </summary> | ||
public new string ServerLoading = "服务器正在重启中,请稍候..."; | ||
|
||
/// <summary> | ||
/// 请求超时 | ||
/// </summary> | ||
public new string RequestTimeout = "请求超时"; | ||
/// <summary> | ||
/// 您输入的账号或密码不正确 | ||
/// </summary> | ||
public new string PasswordError = "您输入的账号或密码不正确"; | ||
|
||
/// <summary> | ||
/// 加载数据失败 | ||
/// </summary> | ||
public new string LoadDataError = "加载数据失败"; | ||
|
||
/// <summary> | ||
/// 该账号已被封禁 | ||
/// </summary> | ||
public new string AcountIsLocked = "该账号已被封禁"; | ||
|
||
/// <summary> | ||
/// 您的账号未登录或已过期 | ||
/// </summary> | ||
public new string AcountNoLogin = "您的账号未登录或已过期"; | ||
|
||
/// <summary> | ||
/// 您的账号已在其它地方登录 | ||
/// </summary> | ||
public new string AcountLogined = "您的账号已在其它地方登录"; | ||
|
||
/// <summary> | ||
/// 充值失败 | ||
/// </summary> | ||
public new string AppStorePayError = "充值失败"; | ||
/// <summary> | ||
/// 获取受权失败 | ||
/// </summary> | ||
public new string GetAccessFailure = "获取受权失败"; | ||
} | ||
} |
Oops, something went wrong.