# Mage Duel sample service
Mage Duel is a TCG (Trading Card Game) implemented as a LINE Blockchain sample service. Players duel with each other, using their card deck. Mage Duel consists of a server and client. This repository only contains server-side code.
Visit [LINE Blockchain Docs](https://docs.blockchain.line.me/sample-services/Mage-duel) for more details.
## Development environment
### OS
* Windows
### Language
* C# (.Net Framework 4.7.2)
### Database
* MariaDB® 10.4.0
## Configuration
Mage Duel server needs a configuration file (`Server/TCGSampleServer/Config/TCGSampleSrvProgramSetting.xml`) with the information on servers and services for integration.
```xml
<?xml version="1.0" encoding="utf-8"?>
<root>
<serverhostinfo id="1" // Identifier for multi-server setup when the multi-server is configured through ServerID. Currently not used.
host="0.0.0.0" // TCP Server Socket host
port="18282" // TCP Server Socket port
keepalivechecktime="1200" // Effective duration of the connection. Cut the connection if the time is not updated after the designated time. (Unit: seconds)
sendingcycle="100" // Time interval of transferring KeepAlive Packet to the client (Unit: seconds)
/>
<serverwebhostinfo host="0.0.0.0" port="28282"/> // WebServer host and port to receive LINE Login callback
<resourceinfo path="../DataTable"/> // Resource Table (Excel File) path
<mysqlinfo server="10.113.~~~~" // SQL DB Host
uid="admin~~~~~" // DB Account
pwd="admin~~~~" // DB Password
database="" // Name of the database to connect to (if blank, it is set as {processName}_{System.Environment.MachineName})
sslmode="none" // Default: none
allow_user_variables="true" // Default: true
database_create="false" // Flag whether to recreate the database table. Delete and recreate the existing database and table for true while access the established database for false.
/>
<lbdinfo uri="https://test-api.blockchain.line.me" // LINE Blockchain Developers API server URL
dappid="6fee1e3c-~~~~~~~" // Service ID. Created at the LINE Blockchain Developers console.
apikey="a17401a9-da4~~~~~~" // Service API Key. Created at the LINE Blockchain Developers console.
apisecret="f5e4b764-~~~~~~~" // API Secret. Created at the LINE Blockchain Developers console.
itemtoken_contractid="2d8~~~~" // Contract ID of item tokens. Created at the LINE Blockchain Developers console.
servicetoken_contractid="f93~~~~~" // Contract ID of service tokens. Created at the LINE Blockchain Developers console.
operaddr="tlink1u8~~~~~~~" // Address of the service wallet. Created at the LINE Blockchain Developers console.
secretkey="O+S9xIqi~~~~~~~~" // SecretKey of the service wallet. Created at the LINE Blockchain Developers console.
/>
<ldcinfo uri="https://api.line-beta.me"/> // LINE Login URL
</root>
```
## Item tokenization
Mage Duel tokenizes in-game assets. Let’s take a look at how various LINE Blockchain tokens are used.
### Ruby
* Primary in-game currency
* Service token
* Players can use Rubies to purchase card packs or Coins at the shop.
### Coin
* Secondary in-game currency
* Fungible item token
* Players can use Coins to pay for card sales registration fee and purchase cards at the card exchange.
### Hero card
* Character card
* Non-fungible item token
* Primary card to create a deck
### Regular card
* Monster card/ equipment card/ magic card
* Non-fungible item token
* Regular cards that can be included in the deck
## Game features and blockchain
Here is which blockchain feature is used on each screen of Mage Duel.
### Deck builder
* Attaching or detaching, using composable tokens
* Registering up to 40 regular cards (child token) to the hero card (parent token)
### Shop
* Purchasing a card pack (Five random regular cards) with Rubies
- Transferring Rubies from the user wallet to the service wallet
- Minting 5 non-fungible item tokens
* Purchasing Coins with Rubies
- Transferring (or minting) Coins from the service wallet to the user wallet
- Transferring Rubies from the user wallet to the service wallet
### Card exchange
* Registering card sales and deducting registration fee
- Transferring Coins from the user wallet to the service wallet
* Purchasing cards registered for sale by users
- Transferring Coins between user wallets
- Transferring cards between user wallets
## How to contribute
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
## License
```
Copyright 2020 LINE Corporation
LINE Corporation licenses this file to you under the Apache License,
version 2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at:
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
```
See [LICENSE](LICENSE) for more details.
没有合适的资源?快使用搜索试试~ 我知道了~
使用区块链实现纸牌游戏 的示例服务_C#_代码_下载
共222个文件
cs:195个
xlsx:7个
dll:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 31 浏览量
2022-06-23
23:30:27
上传
评论
收藏 506KB ZIP 举报
温馨提示
Mage Duel 是作为 LINE 区块链示例服务实现的 TCG(交易卡游戏)。玩家互相决斗,使用他们的卡片组。法师决斗由服务器和客户端组成。此存储库仅包含服务器端代码。
资源推荐
资源详情
资源评论
收起资源包目录
使用区块链实现纸牌游戏 的示例服务_C#_代码_下载 (222个子文件)
NLog.config 3KB
App.config 184B
LBDApiManager.Func.cs 62KB
InternalHandler.LBD.cs 47KB
UriManager.cs 26KB
User.Currency.cs 19KB
LBDApiManager.TokenTypeInfo.cs 18KB
CardShopSlot.cs 14KB
User.Deck.cs 12KB
LBDApiManager.cs 11KB
User.cs 10KB
UserHandler.Trade.cs 10KB
TradingManager.cs 9KB
User.Shop.cs 7KB
Trading.cs 7KB
NetServer.cs 7KB
ShopSlot.cs 7KB
Body.cs 6KB
Respones.cs 6KB
CurrencyShopSlot.cs 6KB
Signature.cs 6KB
UserHandler.Shop.cs 6KB
User.Login.cs 5KB
LDCApiManager.cs 5KB
ProgramSetting.cs 4KB
AppMain.cs 4KB
User.Trade.cs 4KB
UserHandler.Login.cs 4KB
UserMessageDispatcher.cs 4KB
UserHandler.Deck.cs 4KB
User.Info.cs 4KB
InternalHandler.LDC.cs 4KB
Timer.cs 4KB
TCGService.cs 3KB
GCurrency.cs 3KB
InternalMessageDispatcher.cs 3KB
TCurrency.cs 3KB
TCGGameSrv.HttpServer.cs 3KB
LDCApiManager.Func.cs 3KB
ExtensionMethods.cs 3KB
TCGGameSrv.InitDatabase.cs 3KB
HttpManager.cs 3KB
InternalHandler.cs 3KB
User.Card.cs 3KB
ProgramSettingDefine.cs 3KB
User.cs 3KB
EtcShopSlot.cs 2KB
HttpMessageDispatcher.cs 2KB
UriManager.cs 2KB
Program.cs 2KB
IUser.cs 2KB
ErrorCode.cs 2KB
Define.cs 2KB
Currency.cs 2KB
TblTrade.cs 2KB
HttpHandler.cs 2KB
Define.cs 2KB
MessageType.cs 2KB
CardInfo.cs 2KB
ITrading.cs 2KB
UriType.cs 2KB
Nonce.cs 2KB
TblShopSlot.cs 2KB
ShopSlotInfo.cs 2KB
TCGGameSrv.cs 2KB
Define.cs 2KB
TblTradeHistory.cs 2KB
TradeGoodsInfo.cs 1KB
UserHandler.cs 1KB
TblUser.cs 1KB
TCGGameSrv.InitResource.cs 1KB
TblShopSlotOpen.cs 1KB
TradeData.cs 1KB
Packet.cs 1KB
TblCurrency.cs 1KB
TblDeck.cs 1KB
User.TImer.cs 1KB
NetServer.Timer.cs 1KB
TCGGameSrv.InitTcp.cs 1KB
UserInfo.cs 1KB
TblShopSlotCard.cs 1KB
LBDMsg_GetComposableToken.cs 1KB
Respones.cs 1KB
LBDMsg_TokenTypeBalancesOf_NonFungible.cs 1KB
LBDMsg_IssueServiceTokenTransfer.cs 1KB
LBDMsg_Wallet_Fungible_Transfer.cs 1KB
LBDMsg_TransferServiceToken.cs 1KB
LBDMsg_AddTokenParent.cs 1KB
LBDMsg_UserId_Fungible_Transfer.cs 1KB
LBDMsg_TokenBalancesOf_ServiceToken.cs 1KB
IntlMsg_VerifyAccessToken.cs 1KB
LBDMsg_TokenBalancesOf_NonFungible.cs 1KB
UnixTime.cs 1KB
LBDMsg_UserId_NonFungible_Transfer.cs 1KB
LBDMsg_TokenBalancesOf_Fungible.cs 1022B
ReqTradeInfo.cs 1015B
AckShopBuy.cs 1015B
IntlMsg_GetComposableToken.cs 1013B
ReqAuthorizationCallBack.cs 1013B
AckTradeBuyerGiveGoods.cs 1011B
共 222 条
- 1
- 2
- 3
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- unity控制对象移动.rar
- TortoiseSVN-1.14.3.29387-x64-svn-1.14.2
- jdk-8u411-macosx-aarch64.dmg
- docker安装.rar
- 美赛数学建模算法-使用Matlab实现常微分方程OridinaryDifferentialEquation-国赛-题解.zip
- FileUploadTestController.java
- 基于MATLAB的数字水印系统源码+GUI操作界面+全部数据资料+使用文档(高分课程设计).zip
- 美赛数学建模算法-使用Matlab实现非线性规划NonLinearProgramming-国赛-题解.zip
- linux安装java8环境资源包
- pcb问题和3D猴制作外壳.7z
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功