aboutsummaryrefslogtreecommitdiff
path: root/src/server.h
Commit message (Expand)AuthorAge
...
* Add minetest.is_singleplayer()Perttu Ahola2012-03-28
* Texture cache -> Media cache WIPPerttu Ahola2012-03-25
* Lua API for playing soundsPerttu Ahola2012-03-24
* Add event manager and use it to trigger soundsPerttu Ahola2012-03-24
* celeron55's sound system initial frameworkPerttu Ahola2012-03-24
* Rework directory structurePerttu Ahola2012-03-19
* Dynamic sky, fog and cloud colors; sun and moonPerttu Ahola2012-03-18
* Fix and improve Server's privilege get/settersPerttu Ahola2012-03-15
* Add "simple singleplayer mode"; Fix a number of GUI thingsPerttu Ahola2012-03-15
* Proper handling of failing to bind server socketPerttu Ahola2012-03-11
* command-line/world game selectionPerttu Ahola2012-03-11
* Clean up log messages everywherePerttu Ahola2012-03-11
* Initial directory structure reworkPerttu Ahola2012-03-10
* Add minetest.get_worldpath() for getting location for custom dataPerttu Ahola2012-02-28
* Players stay in environment even when dead, damage flash and fall damage fixesKahrl2012-02-05
* Inventory menu (with dragging) improved. Crafting is now handled via a IACTIO...Kahrl2012-01-22
* The huge item definition and item namespace unification patch (itemdef), see ...Kahrl2012-01-12
* Texture cache on client (mostly made by sapier) (breaks network compatibility)Perttu Ahola2012-01-02
* Add InvRef and InvStack (currently untested and unusable)Perttu Ahola2012-01-02
* Add minetest.get_modpath(modname)Perttu Ahola2011-12-11
* Move ServerRemotePlayer to a separate filePerttu Ahola2011-12-02
* Don't send objects or map data before definitions have been sentPerttu Ahola2011-12-02
* Remove stuff made obsolete by making players more ActiveObject-like and raise...Perttu Ahola2011-12-01
* Player-is-SAO WIPPerttu Ahola2011-12-01
* Fix processing of the default_password setting. It is now actually used as th...Kahrl2011-12-01
* CraftItem rework and Lua interfaceKahrl2011-11-29
* Make blocks to be loaded from disk when the active block area reaches themPerttu Ahola2011-11-29
* Crafting definition in scriptsPerttu Ahola2011-11-29
* Do not expose CONTENT_* stuff in content_mapnode.h and use a name converter w...Perttu Ahola2011-11-29
* Node definition namesPerttu Ahola2011-11-29
* Clean mapnode.h and fix other files accordinglyPerttu Ahola2011-11-29
* Node definitions transferPerttu Ahola2011-11-29
* Sending of textures WIPPerttu Ahola2011-11-29
* Move tool definitions to scriptPerttu Ahola2011-11-29
* Tool definition transfer to clientPerttu Ahola2011-11-29
* GameDef compilesPerttu Ahola2011-11-29
* Create framework for getting rid of global definitions of node/tool/item/what...Perttu Ahola2011-11-29
* Scripting WIPPerttu Ahola2011-11-29
* Improve Connection with threading and some kind of congestion controlPerttu Ahola2011-10-20
* Add /clearobjectsPerttu Ahola2011-10-18
* When granting or revoking privileges, notify the target player tooPerttu Ahola2011-10-16
* Handle death and respawn betterPerttu Ahola2011-10-15
* Header file tweaking; mainly for speedPerttu Ahola2011-10-12
* Fixed/extended/modified ban stuff to be good for inclusionPerttu Ahola2011-08-12
* added ipban supportConstantin Wenger2011-08-12
* Notify other players of wielded item changeGiuseppe Bilotta2011-08-11
* fix to the formerPerttu Ahola2011-07-30
* Server configuration is now written when "/#setting whatever = whatever" is i...Perttu Ahola2011-07-30
* map unloading is now a whole lot betterPerttu Ahola2011-06-27
* moved map generator to separate source filesPerttu Ahola2011-06-25
(wide_to_narrow(ctx->parms[1]).c_str()); if(tp == NULL) { os<<L"-!- No such player"; return; } if(ctx->parms[0] == L"grant") tp->privs |= newprivs; else tp->privs &= ~newprivs; os<<L"-!- Privileges change to "; os<<privsToString(tp->privs); } void cmd_time(std::wostringstream &os, ServerCommandContext *ctx) { if(ctx->parms.size() != 2) { os<<L"-!- Missing parameter"; return; } if((ctx->privs & PRIV_SETTIME) ==0) { os<<L"-!- You don't have permission to do that"; return; } u32 time = stoi(wide_to_narrow(ctx->parms[1])); ctx->server->setTimeOfDay(time); os<<L"-!- time_of_day changed."; } void cmd_shutdown(std::wostringstream &os, ServerCommandContext *ctx) { if((ctx->privs & PRIV_SERVER) ==0) { os<<L"-!- You don't have permission to do that"; return; } dstream<<DTIME<<" Server: Operator requested shutdown." <<std::endl; ctx->server->requestShutdown(); os<<L"*** Server shutting down (operator request)"; ctx->flags |= 2; } void cmd_setting(std::wostringstream &os, ServerCommandContext *ctx) { if((ctx->privs & PRIV_SERVER) ==0) { os<<L"-!- You don't have permission to do that"; return; } std::string confline = wide_to_narrow(ctx->parms[1] + L" = " + ctx->parms[2]); g_settings.parseConfigLine(confline); os<< L"-!- Setting changed."; } void cmd_teleport(std::wostringstream &os, ServerCommandContext *ctx) { if((ctx->privs & PRIV_TELEPORT) ==0) { os<<L"-!- You don't have permission to do that"; return; } if(ctx->parms.size() != 2) { os<<L"-!- Missing parameter"; return; } std::vector<std::wstring> coords = str_split(ctx->parms[1], L','); if(coords.size() != 3) { os<<L"-!- You can only specify coordinates currently"; return; } v3f dest(stoi(coords[0])*10, stoi(coords[1])*10, stoi(coords[2])*10); ctx->player->setPosition(dest); ctx->server->SendMovePlayer(ctx->player); os<< L"-!- Teleported."; } std::wstring processServerCommand(ServerCommandContext *ctx) { std::wostringstream os(std::ios_base::binary); ctx->flags = 1; // Default, unless we change it. u64 privs = ctx->privs; if(ctx->parms.size() == 0 || ctx->parms[0] == L"help") { os<<L"-!- Available commands: "; os<<L"status privs "; if(privs & PRIV_SERVER) os<<L"shutdown setting "; if(privs & PRIV_SETTIME) os<<L" time"; if(privs & PRIV_TELEPORT) os<<L" teleport"; if(privs & PRIV_PRIVS) os<<L" grant revoke"; } else if(ctx->parms[0] == L"status") { cmd_status(os, ctx); } else if(ctx->parms[0] == L"privs") { cmd_privs(os, ctx); } else if(ctx->parms[0] == L"grant" || ctx->parms[0] == L"revoke") { cmd_grantrevoke(os, ctx); } else if(ctx->parms[0] == L"time") { cmd_time(os, ctx); } else if(ctx->parms[0] == L"shutdown") { cmd_shutdown(os, ctx); } else if(ctx->parms[0] == L"setting") { cmd_setting(os, ctx); } else if(ctx->parms[0] == L"teleport") { cmd_teleport(os, ctx); } else { os<<L"-!- Invalid command: " + ctx->parms[0]; } return os.str(); }