Send(0, data, true);
}
-void Client::sendChangePassword(const std::wstring oldpassword,
- const std::wstring newpassword)
+void Client::sendChangePassword(const std::wstring &oldpassword,
+ const std::wstring &newpassword)
{
Player *player = m_env.getLocalPlayer();
if(player == NULL)
const std::map<std::string, std::string> &fields);
void sendInventoryAction(InventoryAction *a);
void sendChatMessage(const std::wstring &message);
- void sendChangePassword(const std::wstring oldpassword,
- const std::wstring newpassword);
+ void sendChangePassword(const std::wstring &oldpassword,
+ const std::wstring &newpassword);
void sendDamage(u8 damage);
void sendBreath(u16 breath);
void sendRespawn();
channels[i].queued_commands.push_front(c);
}
}
- catch (ItemNotFoundException e) {
+ catch (ItemNotFoundException &e) {
// intentionally empty
}
}
m_connection->putEvent(e);
}
}
- catch(ProcessedSilentlyException e) {
+ catch(ProcessedSilentlyException &e) {
/* try reading again */
}
}
}
ItemSAO(ServerEnvironment *env, v3f pos,
- const std::string itemstring):
+ const std::string &itemstring):
ServerActiveObject(env, pos),
m_itemstring(itemstring),
m_itemstring_changed(false),
ItemSAO proto_ItemSAO(NULL, v3f(0,0,0), "");
ServerActiveObject* createItemSAO(ServerEnvironment *env, v3f pos,
- const std::string itemstring)
+ const std::string &itemstring)
{
return new ItemSAO(env, pos, itemstring);
}
#include "object_properties.h"
ServerActiveObject* createItemSAO(ServerEnvironment *env, v3f pos,
- const std::string itemstring);
+ const std::string &itemstring);
/*
LuaEntitySAO needs some internals exposed.
{
public:
LuaEntitySAO(ServerEnvironment *env, v3f pos,
- const std::string &name, const std::string &state);
+ const std::string &name, const std::string &state);
~LuaEntitySAO();
u8 getType() const
{ return ACTIVEOBJECT_TYPE_LUAENTITY; }
#include "httpfetch.h"
#include "porting.h"
-Json::Value fetchJsonValue(const std::string url,
- struct curl_slist *chunk) {
+Json::Value fetchJsonValue(const std::string &url,
+ struct curl_slist *chunk) {
#if USE_CURL
HTTPFetchRequest fetchrequest;
std::vector<ModStoreMod> readModStoreList(Json::Value& modlist);
ModStoreModDetails readModStoreModDetails(Json::Value& details);
-Json::Value fetchJsonValue(const std::string url,
- struct curl_slist *chunk);
+Json::Value fetchJsonValue(const std::string &url,
+ struct curl_slist *chunk);
#endif
class BaseException : public std::exception
{
public:
- BaseException(const std::string s) throw()
+ BaseException(const std::string &s) throw()
{
m_s = s;
}
class AsyncQueuedException : public BaseException {
public:
- AsyncQueuedException(std::string s): BaseException(s) {}
+ AsyncQueuedException(const std::string &s): BaseException(s) {}
};
class NotImplementedException : public BaseException {
public:
- NotImplementedException(std::string s): BaseException(s) {}
+ NotImplementedException(const std::string &s): BaseException(s) {}
};
class AlreadyExistsException : public BaseException {
public:
- AlreadyExistsException(std::string s): BaseException(s) {}
+ AlreadyExistsException(const std::string &s): BaseException(s) {}
};
class VersionMismatchException : public BaseException {
public:
- VersionMismatchException(std::string s): BaseException(s) {}
+ VersionMismatchException(const std::string &s): BaseException(s) {}
};
class FileNotGoodException : public BaseException {
public:
- FileNotGoodException(std::string s): BaseException(s) {}
+ FileNotGoodException(const std::string &s): BaseException(s) {}
};
class SerializationError : public BaseException {
public:
- SerializationError(std::string s): BaseException(s) {}
+ SerializationError(const std::string &s): BaseException(s) {}
};
class LoadError : public BaseException {
public:
- LoadError(std::string s): BaseException(s) {}
+ LoadError(const std::string &s): BaseException(s) {}
};
class ContainerFullException : public BaseException {
public:
- ContainerFullException(std::string s): BaseException(s) {}
+ ContainerFullException(const std::string &s): BaseException(s) {}
};
class SettingNotFoundException : public BaseException {
public:
- SettingNotFoundException(std::string s): BaseException(s) {}
+ SettingNotFoundException(const std::string &s): BaseException(s) {}
};
class InvalidFilenameException : public BaseException {
public:
- InvalidFilenameException(std::string s): BaseException(s) {}
+ InvalidFilenameException(const std::string &s): BaseException(s) {}
};
class ProcessingLimitException : public BaseException {
public:
- ProcessingLimitException(std::string s): BaseException(s) {}
+ ProcessingLimitException(const std::string &s): BaseException(s) {}
};
class CommandLineError : public BaseException {
public:
- CommandLineError(std::string s): BaseException(s) {}
+ CommandLineError(const std::string &s): BaseException(s) {}
};
class ItemNotFoundException : public BaseException {
public:
- ItemNotFoundException(std::string s): BaseException(s) {}
+ ItemNotFoundException(const std::string &s): BaseException(s) {}
};
class ServerError : public BaseException {
public:
- ServerError(std::string s): BaseException(s) {}
+ ServerError(const std::string &s): BaseException(s) {}
};
// Only used on Windows (SEH)
class FatalSystemException : public BaseException {
public:
- FatalSystemException(std::string s): BaseException(s) {}
+ FatalSystemException(const std::string &s): BaseException(s) {}
};
/*
InvalidPositionException():
BaseException("Somebody tried to get/set something in a nonexistent position.")
{}
- InvalidPositionException(std::string s):
+ InvalidPositionException(const std::string &s):
BaseException(s)
{}
};
FieldSpec()
{
}
- FieldSpec(const std::wstring name, const std::wstring label,
- const std::wstring fdeflt, int id) :
+ FieldSpec(const std::wstring &name, const std::wstring &label,
+ const std::wstring &fdeflt, int id) :
fname(name),
flabel(label),
fdefault(fdeflt),
bool is_modpack;
// if modpack:
std::map<std::string,ModSpec> modpack_content;
- ModSpec(const std::string name_="", const std::string path_=""):
+ ModSpec(const std::string &name_="", const std::string &path_=""):
name(name_),
path(path_),
depends(),
private:
lua_State *L;
public:
- ModNameStorer(lua_State *L_, const std::string modname):
+ ModNameStorer(lua_State *L_, const std::string &modname):
L(L_)
{
// Store current modname in registry
}
}
-void Server::SendShowFormspecMessage(u16 peer_id, const std::string formspec,
- const std::string formname)
+void Server::SendShowFormspecMessage(u16 peer_id, const std::string &formspec,
+ const std::string &formname)
{
DSTACK(__FUNCTION_NAME);
std::string name;
std::string sha1_digest;
- SendableMediaAnnouncement(const std::string name_="",
- const std::string sha1_digest_=""):
+ SendableMediaAnnouncement(const std::string &name_="",
+ const std::string &sha1_digest_=""):
name(name_),
sha1_digest(sha1_digest_)
{}
std::string path;
std::string data;
- SendableMedia(const std::string &name_="", const std::string path_="",
- const std::string &data_=""):
+ SendableMedia(const std::string &name_="", const std::string &path_="",
+ const std::string &data_=""):
name(name_),
path(path_),
data(data_)
return m_banmanager->getBanDescription(ip_or_name);
}
-void Server::notifyPlayer(const char *name, const std::wstring msg)
+void Server::notifyPlayer(const char *name, const std::wstring &msg)
{
Player *player = m_env->getPlayer(name);
if(!player)
return true;
}
-void Server::notifyPlayers(const std::wstring msg)
+void Server::notifyPlayers(const std::wstring &msg)
{
SendChatMessage(PEER_ID_INEXISTENT,msg);
}
std::string path;
std::string sha1_digest;
- MediaInfo(const std::string path_="",
- const std::string sha1_digest_=""):
+ MediaInfo(const std::string &path_="",
+ const std::string &sha1_digest_=""):
path(path_),
sha1_digest(sha1_digest_)
{
void unsetIpBanned(const std::string &ip_or_name);
std::string getBanDescription(const std::string &ip_or_name);
- void notifyPlayer(const char *name, const std::wstring msg);
- void notifyPlayers(const std::wstring msg);
+ void notifyPlayer(const char *name, const std::wstring &msg);
+ void notifyPlayers(const std::wstring &msg);
void spawnParticle(const char *playername,
v3f pos, v3f velocity, v3f acceleration,
float expirationtime, float size,
void SendMovePlayer(u16 peer_id);
void SendPlayerPrivileges(u16 peer_id);
void SendPlayerInventoryFormspec(u16 peer_id);
- void SendShowFormspecMessage(u16 peer_id, const std::string formspec, const std::string formname);
+ void SendShowFormspecMessage(u16 peer_id, const std::string &formspec, const std::string &formname);
void SendHUDAdd(u16 peer_id, u32 id, HudElement *form);
void SendHUDRemove(u16 peer_id, u32 id);
void SendHUDChange(u16 peer_id, u32 id, HudElementStat stat, void *value);
}
/* If buffer does not exist, consult the fetcher */
- SoundBuffer* getFetchBuffer(const std::string name)
+ SoundBuffer* getFetchBuffer(const std::string &name)
{
SoundBuffer *buf = getBuffer(name);
if(buf)