Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hank Li committed Dec 19, 2019
0 parents commit 8dc596f
Show file tree
Hide file tree
Showing 1,552 changed files with 302,986 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/Source/Framework/ZyGames.Framework/obj
/Source/Framework/ZyGames.Framework/bin
/Source/Framework/ZyGames.Framework.Common/obj
/Source/Framework/ZyGames.Framework.Common/bin
/Source/Middleware/AccountServer/bin
/Source/Middleware/AccountServer/obj
/Source/Middleware/GameServer/bin
/Source/Middleware/GameServer/obj
/Source/Middleware/ScutSecurity/bin
/Source/Middleware/ScutSecurity/obj
/Source/Middleware/ZyGames.Framework.Game/bin
/Source/Middleware/ZyGames.Framework.Game/obj
/Source/Tools/ContractTools/src/ContractTools.WebApp/bin
/Source/Tools/ContractTools/src/ContractTools.WebApp/obj
/Source/Framework/*.suo
/Source/Middleware/*.suo
/SDK/Unity3d/obj
/SDK/Unity3d/Library/metadata
/Source/Framework/packages
obj
bin
testresults
*.suo
Binary file added Document/API/SCUT Server Framework API.chm
Binary file not shown.
Binary file added Document/API/SCUT Server Middleware API.chm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Document/Tutorials/Cocos-Scut开源引擎.pptx
Binary file not shown.
Binary file added Document/Tutorials/Doudizhu of Scut on Azure.docx
Binary file not shown.
Binary file not shown.
Binary file added Document/Tutorials/Scut FAQ.docx
Binary file not shown.
Binary file added Document/Tutorials/Scut on AWS.docx
Binary file not shown.
Binary file added Document/Tutorials/Scut on Azure.docx
Binary file not shown.
Binary file added Document/Tutorials/Scut入门初级教程.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

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.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# README

[![Build Status](http://scutgame.com/images/passing.png?branch=6.7.9.11)](http://scutgame.com/download/)


## Scut是什么?

欢迎使用 Scut
,这是一款免费开源的游戏服务器引擎,适用于开发AVG、SLGRPG、MMOG等类型的网络游戏,同时支持Http、WebSocket和Socket协议通讯,支持Window、Mac和Linux多种平台部署,支持Redis内存数据库和Microsoft
SQL、MySql数据库;服务器引擎框架基于C#编写,游戏逻辑层可以选择使用C#、Python和Lua多种脚本进行开发,支持热更新的方式部署;客户端可以使用Coscos2d、Unity3d、FlashAir与服务器引擎对接;提供了丰富的中间件,可以简单快捷的搭建您的游戏。


## 帮助文档

* [Wiki](http://git.oschina.net/scutgame/Scut/wikis/home)


## 贡献者

* 开源作者(微博): [伍张发](http://weibo.com/plgavin)

* [typ77](http://git.oschina.net/typ77)


## 如何贡献代码

- 首先在[git.oschina.net](http://git.oschina.net)注册一个账号(已有账号可跳过);
-`Scut`的右上角点击`Fork`,将代码添加自己的项目中;
- 下载Git客户端`TortoiseGit`工具,安装工具之前要安装`Git`程序;
- 克隆`Scut`源码地址

```
https://git.oschina.net/scutgame/Scut.git
```
- 在`Scut`代码目录下右击使用`TortoiseGit`提交需要贡献的代码,此时提交的代码还在本机Git仓库;
- 接着操作`Create Pull Request`推送命令,将代码推送到远程`Scut` 代码仓库中;
- 推送成功后,需要等待作者审核代码并合并Push请求成功后才可以完成代码贡献。
## 开源协议
参见根目录`LICENSE`文件。
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Product.SignKey" value=""/>
<add key="Product.ClientDesDeKey" value="j6=9=1ac"/>
<add key="Game.Http.Host" value="pass.scutgame.com,127.0.0.1:8801" />
<add key="Game.Http.Port" value="80" />
<add key="Game.Http.Name" value ="default.ashx"/>
<add key="Redis.Host" value="127.0.0.1:6379"/>
<add key="Redis.Db" value="0"/>
</appSettings>
<connectionStrings>
<add name="SnsCenter" providerName="SqlDataProvider" connectionString="Data Source=localhost;Database=SnsCenter;Uid=sa;Pwd=123" />
</connectionStrings>
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 30 additions & 0 deletions Release/6.7.9.11/AccountServer/Console/NLog.config
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">
<variable name="logDirectory" value="D:/NLog/AccountLog"/>
<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"/>
<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>
Binary file added Release/6.7.9.11/AccountServer/Console/NLog.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions Release/6.7.9.11/AccountServer/Web/Default.ashx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%@ WebHandler Language="C#" CodeBehind="Default.ashx.cs" Class="AccountServer.Default" %>
1 change: 1 addition & 0 deletions Release/6.7.9.11/AccountServer/Web/Global.asax
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="AccountServer.Global" Language="C#" %>
30 changes: 30 additions & 0 deletions Release/6.7.9.11/AccountServer/Web/NLog.config
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">
<variable name="logDirectory" value="D:/NLog/AccountLog"/>
<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"/>
<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>
28 changes: 28 additions & 0 deletions Release/6.7.9.11/AccountServer/Web/Web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings>
<add key="Product.SignKey" value=""/>
<add key="Product.ClientDesDeKey" value="j6=9=1ac"/>
<add key="Redis.Host" value="127.0.0.1:6379" />
<add key="Redis.Db" value="0" />
</appSettings>
<connectionStrings>
<add name="SnsCenter" providerName="SqlDataProvider" connectionString="Data Source=localhost;Database=SnsCenter;Uid=sa;Pwd=123" />
</connectionStrings>

<system.web>
<compilation targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
<system.webServer>
<defaultDocument>
<files>
<add value="Default.ashx"/>
</files>
</defaultDocument>
</system.webServer>
</configuration>
Binary file added Release/6.7.9.11/Console/GameServer.exe
Binary file not shown.
34 changes: 34 additions & 0 deletions Release/6.7.9.11/Console/GameServer.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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="PublishType" value="Debug" />
<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>
Binary file added Release/6.7.9.11/Console/GameServer.pdb
Binary file not shown.
5 changes: 5 additions & 0 deletions Release/6.7.9.11/Console/Install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off

xcopy /y ..\Lib\*.dll .\

ECHO Install Ok & PAUSE
30 changes: 30 additions & 0 deletions Release/6.7.9.11/Console/NLog.config
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 Release/6.7.9.11/Console/Script/CsScript/Action/Action1000.cs
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;
}

}
}
Loading

0 comments on commit 8dc596f

Please sign in to comment.