dongqiao3927 2015-09-20 11:07
浏览 26
已采纳

如何检查服务器的投票是否已被计算在内?

I'm trying to make a minecraft server voting system where when you vote for the server for example here: Minecraft servers list You will get certain points for a successful vote. The question is how to check if a player has successfully voted for server or not? Anyway to check the string of "Your vote has been successful" or something? Thank you for your answers.

  • 写回答

1条回答 默认 最新

  • duanchun5520 2015-09-20 11:18
    关注

    On JS side, do an AJAX request when the user vote, and then wait for a callback after the server responded, then you can write "Vote successful" or other stuff.

    On Server side (no matter if this is php or another language), you'll have to store information about the request, like user IP, to prevent him for multiple votes.

    You could also store this information in a cookie on the client side, or in the local storage, but it can easily be cleaned by the user.

    Or even, associate the vote with an email, and associate the email with the request.

    I don't know anyway if there is a definitive solution to prevent multiple votes in this case, because user can create new mail account, modify its IP, go through a proxy, ... Best way is create an auth mechanism that will force each user to be auth before voting, I guess.

    This post only exposes concepts anyway because your question is quite too large to answer it exactly here.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大