{"id":28962748,"url":"https://github.com/phuhao00/suigserver","last_synced_at":"2025-06-24T03:11:58.681Z","repository":{"id":300522950,"uuid":"1006145774","full_name":"phuhao00/suigserver","owner":"phuhao00","description":"A multiplayer game server implementation for the Sui blockchain ecosystem.","archived":false,"fork":false,"pushed_at":"2025-06-22T06:51:42.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T07:28:48.228Z","etag":null,"topics":["blockchain","blockchain-technology","contracts","move","rust","sui"],"latest_commit_sha":null,"homepage":"","language":"Move","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phuhao00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-21T15:42:46.000Z","updated_at":"2025-06-22T07:00:35.000Z","dependencies_parsed_at":"2025-06-22T07:40:35.732Z","dependency_job_id":null,"html_url":"https://github.com/phuhao00/suigserver","commit_stats":null,"previous_names":["phuhao00/suigserver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phuhao00/suigserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhao00%2Fsuigserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhao00%2Fsuigserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhao00%2Fsuigserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhao00%2Fsuigserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phuhao00","download_url":"https://codeload.github.com/phuhao00/suigserver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phuhao00%2Fsuigserver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261595784,"owners_count":23182249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","blockchain-technology","contracts","move","rust","sui"],"created_at":"2025-06-24T03:11:58.153Z","updated_at":"2025-06-24T03:11:58.665Z","avatar_url":"https://github.com/phuhao00.png","language":"Move","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sui Game Server\n\nA multiplayer game server implementation for the Sui blockchain ecosystem.\n\n## Project Structure\n\n```\nsuigserver/\n├── go.mod                          # Go module definition\n├── server/\n│   ├── cmd/\n│   │   ├── game/main.go           # Full actor-based server (requires external deps)\n│   │   └── simple/main.go         # Simple server (no external deps)\n│   ├── configs/                   # Configuration management\n│   ├── internal/\n│   │   ├── actor/                # Actor system implementation\n│   │   │   ├── messages/         # Message definitions\n│   │   │   ├── room_actor.go     # Room management\n│   │   │   ├── room_manager_actor.go\n│   │   │   ├── session_actor.go  # Player session handling\n│   │   │   └── world_manager_actor.go\n│   │   ├── game/                 # Game logic\n│   │   ├── model/                # Data models\n│   │   ├── network/              # Network layer\n│   │   ├── simple/               # Simple server implementation\n│   │   └── sui/                  # Sui blockchain integration\n├── contracts/                     # Move smart contracts\n│   ├── combat_system/\n│   ├── game_world/\n│   ├── guild_system/\n│   ├── items_system/\n│   ├── marketplace_system/\n│   └── player_system/\n└── docs/                         # Documentation\n```\n\n## Features\n\n### Current Features\n- **Simple Server**: Basic TCP server with room-based chat\n- **Actor-based Server**: Advanced server using actor model (requires dependencies)\n- **Smart Contracts**: Sui Move contracts for game systems\n- **Player Management**: Basic authentication and session handling\n- **Room System**: Join/leave rooms and chat functionality\n- **Configuration Management**: JSON-based configuration\n\n### Planned Features\n- Sui blockchain integration\n- NFT-based player items\n- Combat system\n- Guild system\n- Marketplace\n- Player progression\n\n## Quick Start\n\n### Option 1: Simple Server (Recommended for testing)\n\nThe simple server requires no external dependencies and can be built immediately:\n\n```bash\n# Build the simple server\ngo build -o bin/simple-server.exe server/cmd/simple/main.go\n\n# Run the server\n./bin/simple-server.exe -port 8080\n```\n\n### Option 2: Full Actor-based Server\n\nThe full server uses the Proto.Actor framework but requires external dependencies:\n\n```bash\n# Install dependencies (requires internet connection)\ngo mod tidy\n\n# Build the full server\ngo build -o bin/game-server.exe server/cmd/game/main.go\n\n# Run the server\n./bin/game-server.exe\n```\n\n## Configuration\n\n### Simple Server\nThe simple server uses command-line flags:\n- `-port`: Port to run the server on (default: 8080)\n\n### Full Server\nThe full server uses a JSON configuration file. An example config will be created automatically as `config.json`.\n\n## Client Commands\n\nConnect to the server using telnet or any TCP client:\n\n```bash\ntelnet localhost 8080\n```\n\nAvailable commands:\n- `/auth \u003cname\u003e` - Authenticate with a player name\n- `/join \u003croom\u003e` - Join a room (creates if doesn't exist)\n- `/say \u003cmessage\u003e` - Send a message to all players in the current room\n- `/quit` - Disconnect from the server\n\n## Example Usage\n\n1. Start the server:\n   ```bash\n   ./bin/simple-server.exe -port 8080\n   ```\n\n2. Connect two clients:\n   ```bash\n   # Terminal 1\n   telnet localhost 8080\n   /auth Alice\n   /join gameroom\n   /say Hello everyone!\n   \n   # Terminal 2  \n   telnet localhost 8080\n   /auth Bob\n   /join gameroom\n   /say Hi Alice!\n   ```\n\n## Smart Contracts\n\nBuild the smart contracts:\n\n```bash\n# Combat System\ncd \"c:\\file\\sui_project\\gamessever\\suigserver\\contracts\\combat_system\"\nsui move build --skip-fetch-latest-git-deps\n```\n\n## Development\n\n### Building Smart Contracts\n\nEach contract directory has its own build scripts:\n\n```bash\n# For Windows\ncd contracts/player_system\n.\\build.bat\n\n# For Linux/Mac\ncd contracts/player_system\n./build.sh\n```\nsui client switch --env devnet\n\n### Adding New Features\n\n1. **Simple Server**: Modify `server/internal/simple/server.go`\n2. **Full Server**: Add new actors in `server/internal/actor/`\n3. **Smart Contracts**: Add new Move contracts in `contracts/`\n\n## Architecture\n\n### Simple Server\n- Single-threaded with goroutines for each client\n- In-memory room and player management\n- Basic command parsing and message routing\n\n### Full Server (Actor Model)\n- `PlayerSessionActor`: Manages individual player connections\n- `RoomActor`: Manages game rooms and player interactions\n- `RoomManagerActor`: Coordinates room creation and discovery\n- `WorldManagerActor`: Handles global game state\n\n### Smart Contracts\n- **Player System**: Player NFTs and character data\n- **Item System**: Game items and equipment\n- **Combat System**: Battle mechanics and results\n- **Guild System**: Player organizations\n- **Marketplace**: Trading system for game assets\n\n## Troubleshooting\n\n### Network Issues\nIf you get connection errors when building the full server:\n1. Use the simple server instead\n2. Check your internet connection\n3. Try using Go proxy: `go env -w GOPROXY=direct`\n\n### Port Already in Use\nIf the port is already in use:\n1. Change the port: `./simple-server.exe -port 8081`\n2. Or stop the conflicting process\n\n### Build Errors\n1. Ensure Go 1.21 or later is installed\n2. Run `go mod tidy` to fix module issues\n3. Check that all import paths are correct\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Test with both simple and full servers\n5. Submit a pull request\n\n## License\n\nSee LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphuhao00%2Fsuigserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphuhao00%2Fsuigserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphuhao00%2Fsuigserver/lists"}